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 +---