Compare commits

...
Sign in to create a new pull request.

6 commits

Author SHA1 Message Date
c6501564f6 Merge branch 'main' into twitter-archive 2025-08-28 11:21:49 -06:00
f3da1087e3 List and page_summary templates for twitter section 2025-08-28 11:19:48 -06:00
90c2ba8787 Update termlite submodule 2025-08-28 07:56:48 -06:00
e8899a6ead Tweets permalink config 2025-08-28 07:53:10 -06:00
74c796d5cd 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.
2025-08-28 07:52:55 -06:00
90806aa8f6 Retweet and Favorite string localizations 2025-08-28 07:51:55 -06:00
7 changed files with 82 additions and 1 deletions

View file

@ -1,2 +1,3 @@
blog: blog/:year/:month/:slug/
photos: photos/:year/:month/:slug/
tweets: tweets/:year/:month/:slug/

View file

@ -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 }}

3
content/tweets/_index.md Normal file
View file

@ -0,0 +1,3 @@
---
title: Tweets
---

View file

@ -11,3 +11,6 @@ nethackScore: Score
nethackDungeonLevel: Dungeon Level
nethackCharacterLevel: Character Level
nethackHP: HP
favorites: Favorites
retweets: Retweets

14
layouts/tweets/list.html Normal file
View file

@ -0,0 +1,14 @@
{{ define "main" }}
<main class="main--list">
<header class="page-header">
{{ partial "page_header.html" (dict "page" .) }}
</header>
{{ $paginator := .Paginate .Pages.ByPublishDate.Reverse 100 }}
{{ range $paginator.Pages }}
{{ .Render "page_summary" }}
{{ end }}
{{ partial "pagination.html" . }}
</main>
{{ end }}

View file

@ -0,0 +1,18 @@
<article class="page-summary">
{{ .Content }}
{{- if .Date -}}
{{/* TODO: Include time in this date */}}
{{- partial "page/date.html" (dict "page" . "style" "datetime") -}}
{{- end }}
<div class="tag" data-name="favorites">
<span class="tag__name">{{ T "favorites" }}</span>
<span class="tag__value">{{ .Params.favoriteCount }}</span>
</div>
<div class="tag" data-name="retweets">
<span class="tag__name">{{ T "retweets" }}</span>
<span class="tag__value">{{ .Params.retweetCount }}</span>
</div>
</article>

@ -1 +1 @@
Subproject commit d158b0db8ebaaad35c5ed7fea31db7bee930eb03
Subproject commit 4c101a552eb10ed87a5bec5bee741e65aa80daec