Skip to content

Commit

Permalink
Switch TinyLetter to Substack
Browse files Browse the repository at this point in the history
  • Loading branch information
Khemarato Bhikkhu committed Dec 28, 2023
1 parent f8e230b commit 53d815e
Show file tree
Hide file tree
Showing 10 changed files with 105 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/links.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
uses: lycheeverse/[email protected]
with:
lycheeVersion: '0.12.0'
args: --user-agent "${{ env.USER_AGENT }}" --base=https://buddhistuniversity.net --exclude-link-local --timeout=30 --retry-wait-time=3 --max-redirects=8 --exclude=researchgate.net --exclude=illeakyw.sirv.com --exclude=googleapis.com --exclude=google.com --exclude=accesstoinsight.org --exclude=suttacentral.net --exclude=dhammawheel.com --exclude=doi.org --exclude=github.com --exclude=openlibrary.org --exclude=google-analytics.com --exclude=worldcat.org --exclude=tinyletter.com --exclude=schema.org --exclude=gstatic.com --exclude-mail --verbose --no-progress --cache --exclude-path=prod/content 'prod/**/*.html' 'main/_content/*/*.txt' prod/site.webmanifest prod/browserconfig.xml
args: --user-agent "${{ env.USER_AGENT }}" --base=https://buddhistuniversity.net --exclude-link-local --timeout=30 --retry-wait-time=3 --max-redirects=8 --exclude=researchgate.net --exclude=illeakyw.sirv.com --exclude=googleapis.com --exclude=google.com --exclude=accesstoinsight.org --exclude=suttacentral.net --exclude=dhammawheel.com --exclude=doi.org --exclude=github.com --exclude=openlibrary.org --exclude=google-analytics.com --exclude=worldcat.org --exclude=schema.org --exclude=gstatic.com --exclude-mail --verbose --no-progress --cache --exclude-path=prod/content 'prod/**/*.html' 'main/_content/*/*.txt' prod/site.webmanifest prod/browserconfig.xml
- name: Create GitHub Issue
uses: peter-evans/create-issue-from-file@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ url: "https://buddhistuniversity.net" # the base hostname & protocol for your si
GA4: G-B3PH0LF6QQ
github_repo: buddhist-uni/buddhist-uni.github.io
github_branch: main
tinyletter_username: buddhist-uni
substack_username: buddhistuniversity
twitter_username_HIDDEN: buddhistuni
mastodon_link: https://digipres.club/@obu
header_pages: [about.md, courses.md, library.md, blog.md, search.html]
Expand Down
1 change: 1 addition & 0 deletions _includes/social.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<ul class="social-media-list">{% comment %}classname used by buggytrack.js{% endcomment %}
{%- if site.tinyletter_username -%}<li><a href="https://tinyletter.com/{{ site.tinyletter_username | cgi_escape | escape }}"><svg class="svg-icon"><use xlink:href="{{ '/assets/imgs/tinyletter-icon.svg#theicon' | relative_url }}"></use></svg> <span class="username" style="font-style: italic; font-family: Georgia, Times, serif;">TinyLetter</span></a></li>{%- endif -%}
{%- if site.substack_username -%}<li><a href="https://{{ site.substack_username }}.substack.com"><i class="fas fa-bookmark"></i> <span class="username">Substack</span></a></li>{%- endif -%}
{%- if site.github_repo -%}<li><a href="https://github.com/{{ site.github_repo }}"><svg class="svg-icon"><use xlink:href="{{ '/assets/imgs/minima-social-icons.svg#github' | relative_url }}"></use></svg> <span class="username">GitHub</span></a></li>{%- endif -%}
{%- if site.twitter_username -%}<li><a href="https://www.twitter.com/{{ site.twitter_username| cgi_escape | escape }}"><svg class="svg-icon"><use xlink:href="{{ '/assets/imgs/minima-social-icons.svg#twitter' | relative_url }}"></use></svg> <span class="username">Twitter</span></a></li>{%- endif -%}
{%- if site.mastodon_link -%}<li><a rel="me" href="{{ site.mastodon_link }}"><i class="fab fa-mastodon"></i> <span class="username">Mastodon</span></a></li>{%- endif -%}
Expand Down
2 changes: 1 addition & 1 deletion _layouts/post.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ <h1 class="post-title p-name" itemprop="name headline">{{ page.title | escape }}
<time class="dt-published" datetime="{{ page.date | date_to_xmlschema }}" itemprop="datePublished">
{%- assign date_format = site.minima.date_format | default: "%b %-d, %Y" -%}
{{ page.date | date: date_format }}</time>.
For the latest, <a href="https://tinyletter.com/buddhist-uni">subscribe here</a>.
For the latest, <a href="https://buddhistuniversity.substack.com">subscribe here</a>.
</p>
</header>

Expand Down
2 changes: 1 addition & 1 deletion _posts/2020-03-13-welcome.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Every piece featured in [the bibliographies](/tags/) has been vetted for both ac

For a video tour of the website, [click here](https://youtu.be/TPmTxHuQ9AI?t=117s)!

As I slowly review and add more content, I highlight the best finds [here](/blog) as well as in the [email newsletter](https://tinyletter.com/buddhist-uni){:target="_blank" ga-event-value="0.5"}, so be sure to subscribe for the best free content [on Buddhism](/tags/buddhism) available online.
As I slowly review and add more content, I highlight the best finds [here](/blog) as well as in the [email newsletter](https://buddhistuniversity.substack.com){:target="_blank" ga-event-value="0.5"}, so be sure to subscribe for the best free content [on Buddhism](/tags/buddhism) available online.

Here are a few of my favorite pieces you might want to check out first, if you haven't already:

Expand Down
14 changes: 13 additions & 1 deletion _sass/nimitta.scss
Original file line number Diff line number Diff line change
Expand Up @@ -191,10 +191,22 @@ figure figcaption {
padding: 0;
margin-right: 5px;
}
i.fab {
i.fab, i.fas, i.far {
width: 0.9em;
font-size: 19px;
margin-right: 4.5px;
}
i.fa-bookmark::after {
content: "";
height: 2px;
border: 2.5px solid $banner-color;
display: block;
transform: translate(-3px, -16.7px);
width: 1em;
}
i.fa-bookmark {
transform: scaleX(1.2) translateX(2px);
}
}

.site-nav {
Expand Down
4 changes: 2 additions & 2 deletions blog.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ big_height: 4012
banner_info: <a href="https://commons.wikimedia.org/wiki/File:High_Tap.jpg">Rod Waddington</a>, <a href="https://creativecommons.org/licenses/by-sa/2.0">CC BY-SA 2.0</a>
---

The University is still a work in progress. As it continues to expand, the University Newsletter will mark the arrival of new [courses](/courses) and the best new [content](/library). To hear about the latest, subscribe to one of our [atom (rss) feeds](/feed) or sign up for our [emails](https://tinyletter.com/buddhist-uni){:target="_blank" ga-event-value="0.4"}:
The University is still a work in progress. As it continues to expand, the University Newsletter will mark the arrival of new [courses](/courses) and the best new [content](/library). To hear about the latest, subscribe to one of our [atom (rss) feeds](/feed) or sign up for our [emails](https://buddhistuniversity.substack.com){:target="_blank" ga-event-value="0.4"}:

<form style="margin-bottom:23px;border:1px solid #ccc;padding:3px;text-align:center;" action="https://tinyletter.com/buddhist-uni" method="post" target="popupwindow" onsubmit="window.open('https://tinyletter.com/buddhist-uni', 'popupwindow', 'scrollbars=yes,width=800,height=600');return true"><p><label for="tlemail">Enter your email address below to subscribe:</label></p><p><input type="text" style="min-width:50%" name="email" id="tlemail" /></p><input type="hidden" value="1" name="embed"/><input type="submit" value="Subscribe" /><p><a href="https://tinyletter.com/buddhist-uni" target="_blank">powered by TinyLetter</a></p></form>
<iframe src="https://buddhistuniversity.substack.com/embed" width="100%" height="320" style="border:1px solid #EEE; background:white;" frameborder="0" scrolling="no"></iframe>
12 changes: 12 additions & 0 deletions buddhist-uni.github.io.code-workspace
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"folders": [
{
"path": "."
}
],
"settings": {
"files.associations": {
"*.html": "liquid"
}
}
}
6 changes: 3 additions & 3 deletions scripts/gdrive.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@
from strutils import (
titlecase,
git_root_folder,
system_open,
input_with_prefill,
input_with_tab_complete
input_with_tab_complete,
)
import json
import re
Expand Down Expand Up @@ -119,7 +118,8 @@ def youtube():
return build('youtube', 'v3', credentials=google_credentials())

def get_ytvideo_snippet(ytid):
return youtube().videos().list(id=ytid,part="snippet").execute().get("items")[0].get("snippet")
snippet = youtube().videos().list(id=ytid,part="snippet").execute().get("items")[0].get("snippet")
return {k: snippet[k] for k in ['title', 'description', 'tags'] if k in snippet}

def get_subfolders(folderid):
folderquery = f"'{folderid}' in parents and mimeType='application/vnd.google-apps.folder' and trashed=false"
Expand Down
70 changes: 70 additions & 0 deletions scripts/strutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ def ANSI_MOVE_UP(n):
MONTHS = ['jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul', 'aug', 'sep', 'oct', 'nov', 'dec']
abnormalchars = re.compile('[^\w\s]')
sutta_id_re = re.compile(r'^([a-zA-Z]+)(\d+)[\.]?([-–\d]*)$')
yt_url_to_id_re = re.compile(r'(?:youtube(?:-nocookie)?\.com\/(?:[^\/\n\s]+\/\S+\/|(?:v|e(?:mbed)?)\/|\S*?[?&]v=)|youtu\.be\/)([a-zA-Z0-9_-]{11})')

HOSTNAME_BLACKLIST = {
"www.questia.com",
Expand Down Expand Up @@ -111,6 +112,75 @@ def stdout_make_room(lines: int):
return diff
return 0

def checklist_prompt(options: list[str], default=False):
selections = []
if isinstance(default, list):
selections = default[:len(options)] + [False] * max(0, len(options) - len(default))
else:
selections = [default for i in options]
tsize = os.get_terminal_size()
length = len(options)
i = 0
room = min(tsize.lines - 2, length) + 1
r = (0, room-1)
space = tsize.columns - 6
options = [trunc(t, space) for t in options]
stdin = sys.stdin.fileno()
stdout_make_room(room)
old_settings = termios.tcgetattr(stdin)
tty.setraw(stdin)
try:
while True:
cout(f"{ANSI_RESTORE_POSITION}{ANSI_ERASE_HERE_TO_END}{ANSI_RESTORE_POSITION}")
for j in range(r[0], r[1]):
if j == i:
cout(">")
else:
cout(" ")
cout("[")
if selections[j]:
cout("X")
else:
cout(" ")
cout(f"] {options[j]}")
cout(ANSI_RETURN_N_DOWN(1))
if i == length:
cout("> ")
else:
cout(" ")
cout("Accept")
ch = sys.stdin.read(1)
if ch == '\x03':
raise KeyboardInterrupt()
elif ch in ['\r', '\x04', '\n', ' ', 'x', 'X', '-']:
if i == length:
break
else:
selections[i] = not selections[i]
elif ch == '\x1b': # ESC
ch = sys.stdin.read(1)
if ch == '[': # we're getting a control char (e.g. arrow keys)
ch = sys.stdin.read(1)
# A=up, B=down, C=right, D=left, H=home, F=end
if i > 0 and (ch == 'A' or ch == 'D'):
i -= 1
if i < r[0]:
r = (r[0]-1, r[1]-1)
if (ch == 'B' or ch == 'C') and (length > i):
i += 1
if i > r[1]:
r = (r[0]+1, r[1]+1)
if ch == "F":
i = length
r = (length-room+1, length)
if ch == 'H':
i = 0
r = (0, room-1)
finally:
cout(f"{ANSI_RESTORE_POSITION}{ANSI_RETURN_N_DOWN(room)}\n")
termios.tcsetattr(stdin, termios.TCSADRAIN, old_settings)
return selections

def radio_dial(options):
SEARCH_ROOM = 3
i = 0
Expand Down

0 comments on commit 53d815e

Please sign in to comment.