Add support for lastmod (#19)

This commit is contained in:
Lukas Joswiak 2021-04-10 18:54:26 -07:00 committed by GitHub
parent 2a641ceb99
commit 3e7256c7ea
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 5 deletions

View file

@ -43,7 +43,7 @@ main#content ul#posts li a:hover {
color: #21c7ff; color: #21c7ff;
} }
main#content header#post-header time { main#content header#post-header div {
color: #a7a7a7; color: #a7a7a7;
} }
{{- if not (eq .Site.Params.dark "on") -}} {{- if not (eq .Site.Params.dark "on") -}}

View file

@ -142,7 +142,7 @@ main#content header#post-header h1 {
line-height: 1.15; line-height: 1.15;
} }
main#content header#post-header time { main#content header#post-header div {
display: block; display: block;
font-size: 0.85em; font-size: 0.85em;
color: #767676; color: #767676;

View file

@ -2,9 +2,15 @@
<article> <article>
<header id="post-header"> <header id="post-header">
<h1>{{ .Title }}</h1> <h1>{{ .Title }}</h1>
{{- if isset .Params "date" -}} <div>
<time>{{ .Date.Format "January 2, 2006" }}</time> {{- if isset .Params "date" -}}
{{- end -}} {{ if eq .Lastmod .Date }}
<time>{{ .Date.Format "January 2, 2006" }}</time>
{{ else }}
Updated <time>{{ .Lastmod.Format "January 2, 2006" }}</time>
{{ end }}
{{- end -}}
</div>
</header> </header>
{{- .Content -}} {{- .Content -}}
</article> </article>