Bones of a Twitter section

Copied over the templates from blog/ and set up permalinks.
Drew some bespoke star and retweet icons.
Wrote a script to import data from the archive.
This commit is contained in:
Eryn Wells 2023-09-23 09:52:33 -07:00
parent 16f96558cc
commit cac32298b8
10 changed files with 362 additions and 0 deletions

View file

@ -0,0 +1,7 @@
<li class=tweet>
{{ .Content }}
<ul class=metadata>
<li class=timestamp><a href="{{ .Permalink }}">{{ .Date | time.Format ":date_full" }}, {{ .Date | time.Format ":time_short" }}</a></li>
</ul>
{{ partial "development/draft_tag.html" . }}
</li>

26
layouts/twitter/list.html Normal file
View file

@ -0,0 +1,26 @@
{{ define "header" }}
{{ partial "header.html" . }}
{{ end }}
{{ define "main" }}
<h1>{{ .Title }}</h1>
{{ .Content }}
{{ $paginator := .Paginator 100 }}
{{ template "_internal/pagination.html" . }}
<ul class=tweets>
{{ range $paginator.Pages }}
{{- if or (not .Draft) (not hugo.IsProduction) -}}
{{- .Render "li_grid_with_date" -}}
{{- end -}}
{{- end -}}
</ul>
{{ template "_internal/pagination.html" . }}
{{ end }}
{{ define "footer" }}
{{ partial "footer.html" . }}
{{ end }}

View file

View file

View file

@ -0,0 +1,15 @@
{{ define "main" }}
<article class=tweet>
{{ .Content }}
<footer>
<ul class=metadata>
<li class=timestamp>
{{ .Date | time.Format ":date_full" }},
{{ .Date | time.Format ":time_short" }}
</li>
<li class=fav><img src="/images/star-unfilled.png" width=12 height=l2> {{ .Params.tweet.tweet.favorite_count }}</li>
<li class=rt><img src="/images/retweet.png" width=14 height=14> {{ .Params.tweet.tweet.retweet_count }}</li>
</ul>
</footer>
</article>
{{ end }}