From 90806aa8f638868f9c38963aa26f02a58772bb72 Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Thu, 28 Aug 2025 07:51:55 -0600 Subject: [PATCH 1/5] Retweet and Favorite string localizations --- i18n/en.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/i18n/en.yaml b/i18n/en.yaml index 11d2838..1d98149 100644 --- a/i18n/en.yaml +++ b/i18n/en.yaml @@ -11,3 +11,6 @@ nethackScore: Score nethackDungeonLevel: Dungeon Level nethackCharacterLevel: Character Level nethackHP: HP + +favorites: Favorites +retweets: Retweets From 74c796d5cd62fcaa44ef49bb22326c52db209af6 Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Thu, 28 Aug 2025 07:52:55 -0600 Subject: [PATCH 2/5] Section and content generator templates This is not final. I think the content generator will ultimately operate on a preprocessed version of the tweets JSON data from the Twitter archive. --- content/tweets/_content.gotmpl.tmp | 42 ++++++++++++++++++++++++++++++ content/tweets/_index.md | 3 +++ 2 files changed, 45 insertions(+) create mode 100644 content/tweets/_content.gotmpl.tmp create mode 100644 content/tweets/_index.md diff --git a/content/tweets/_content.gotmpl.tmp b/content/tweets/_content.gotmpl.tmp new file mode 100644 index 0000000..c8f07df --- /dev/null +++ b/content/tweets/_content.gotmpl.tmp @@ -0,0 +1,42 @@ +{{/* vim: ft=gohtmltmpl: */}} + +{{ $tweets := slice }} +{{ with resources.Get "twitter/tweets.json" }} + {{ with . | transform.Unmarshal }} + {{ $tweets = . }} + {{ end }} +{{ end }} + +{{ range $tweets }} + {{ $tweet := .tweet }} + + {{ + $content := dict + "mediaType" "text/markdown" + "value" (partial "twitter/assembleTweetMarkdown.html" $tweet) + }} + + {{ $creationDate := partial "twitter/parseCreatedAtDate.html" $tweet.created_at }} + {{ $title := printf "Tweet on %s" (time.Format "2 January 2005" $creationDate) }} + {{ $path := printf "%s/%s" $creationDate.Year $tweet.id_str }} + + {{ $dates := dict "date" $creationDate }} + + {{ + $params := dict + "favoriteCount" $tweet.favorite_count + "retweetCount" $tweet.retweet_count + }} + + {{ + $page := dict + "title" $title + "dates" $dates + "content" $content + "kind" "page" + "params" $params + "path" $path + }} + + {{ $.AddPage $page }} +{{ end }} diff --git a/content/tweets/_index.md b/content/tweets/_index.md new file mode 100644 index 0000000..dc31a57 --- /dev/null +++ b/content/tweets/_index.md @@ -0,0 +1,3 @@ +--- +title: Tweets +--- From e8899a6ead72d9770c24b549101511b19ff50822 Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Thu, 28 Aug 2025 07:53:10 -0600 Subject: [PATCH 3/5] Tweets permalink config --- config/_default/permalinks.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/config/_default/permalinks.yaml b/config/_default/permalinks.yaml index 8efe757..efcaf6c 100644 --- a/config/_default/permalinks.yaml +++ b/config/_default/permalinks.yaml @@ -1,2 +1,3 @@ blog: blog/:year/:month/:slug/ photos: photos/:year/:month/:slug/ +tweets: tweets/:year/:month/:slug/ From 90c2ba8787c125c845a7917989ff8b982af6ee12 Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Thu, 28 Aug 2025 07:56:48 -0600 Subject: [PATCH 4/5] Update termlite submodule --- themes/termlite | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/termlite b/themes/termlite index df3d9cf..55977d6 160000 --- a/themes/termlite +++ b/themes/termlite @@ -1 +1 @@ -Subproject commit df3d9cf039058fff9a9f9bf86daf383562e99964 +Subproject commit 55977d6e6f285ad99d15f9f0061c65d7165fe6c0 From f3da1087e3c197651e7d993f252383d7e9122031 Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Thu, 28 Aug 2025 11:19:48 -0600 Subject: [PATCH 5/5] List and page_summary templates for twitter section --- layouts/tweets/list.html | 14 ++++++++++++++ layouts/tweets/page_summary.html | 18 ++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 layouts/tweets/list.html create mode 100644 layouts/tweets/page_summary.html diff --git a/layouts/tweets/list.html b/layouts/tweets/list.html new file mode 100644 index 0000000..07ecbc5 --- /dev/null +++ b/layouts/tweets/list.html @@ -0,0 +1,14 @@ +{{ define "main" }} +
+ + + {{ $paginator := .Paginate .Pages.ByPublishDate.Reverse 100 }} + {{ range $paginator.Pages }} + {{ .Render "page_summary" }} + {{ end }} + + {{ partial "pagination.html" . }} +
+{{ end }} diff --git a/layouts/tweets/page_summary.html b/layouts/tweets/page_summary.html new file mode 100644 index 0000000..4cf8edf --- /dev/null +++ b/layouts/tweets/page_summary.html @@ -0,0 +1,18 @@ +
+ {{ .Content }} + + {{- if .Date -}} + {{/* TODO: Include time in this date */}} + {{- partial "page/date.html" (dict "page" . "style" "datetime") -}} + {{- end }} + +
+ {{ T "favorites" }} + {{ .Params.favoriteCount }} +
+ +
+ {{ T "retweets" }} + {{ .Params.retweetCount }} +
+