Compare commits
6 commits
main
...
twitter-ar
Author | SHA1 | Date | |
---|---|---|---|
c6501564f6 | |||
f3da1087e3 | |||
90c2ba8787 | |||
e8899a6ead | |||
74c796d5cd | |||
90806aa8f6 |
7 changed files with 82 additions and 1 deletions
|
@ -1,2 +1,3 @@
|
||||||
blog: blog/:year/:month/:slug/
|
blog: blog/:year/:month/:slug/
|
||||||
photos: photos/:year/:month/:slug/
|
photos: photos/:year/:month/:slug/
|
||||||
|
tweets: tweets/:year/:month/:slug/
|
||||||
|
|
42
content/tweets/_content.gotmpl.tmp
Normal file
42
content/tweets/_content.gotmpl.tmp
Normal 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
3
content/tweets/_index.md
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
---
|
||||||
|
title: Tweets
|
||||||
|
---
|
|
@ -11,3 +11,6 @@ nethackScore: Score
|
||||||
nethackDungeonLevel: Dungeon Level
|
nethackDungeonLevel: Dungeon Level
|
||||||
nethackCharacterLevel: Character Level
|
nethackCharacterLevel: Character Level
|
||||||
nethackHP: HP
|
nethackHP: HP
|
||||||
|
|
||||||
|
favorites: Favorites
|
||||||
|
retweets: Retweets
|
||||||
|
|
14
layouts/tweets/list.html
Normal file
14
layouts/tweets/list.html
Normal 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 }}
|
18
layouts/tweets/page_summary.html
Normal file
18
layouts/tweets/page_summary.html
Normal 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
|
Loading…
Add table
Add a link
Reference in a new issue