mirror of
https://github.com/Brandon-Rozek/website-theme.git
synced 2024-11-09 10:50:34 -05:00
When updated, posts now show date updated
This commit is contained in:
parent
4138894182
commit
c6e682c8b9
2 changed files with 11 additions and 2 deletions
|
@ -235,3 +235,5 @@ nav li {
|
||||||
}
|
}
|
||||||
|
|
||||||
#webmentions img { max-height: 1.2em; margin-right: -1ex; }
|
#webmentions img { max-height: 1.2em; margin-right: -1ex; }
|
||||||
|
|
||||||
|
.date-updated { margin-top: -8px; }
|
||||||
|
|
|
@ -2,11 +2,18 @@
|
||||||
<article class="h-entry">
|
<article class="h-entry">
|
||||||
<h1 class='title p-name'>{{ .Title }}</h1>
|
<h1 class='title p-name'>{{ .Title }}</h1>
|
||||||
{{ partial "header.html" . }}
|
{{ partial "header.html" . }}
|
||||||
|
<a style="display: none" class="u-url" href="{{ .Permalink }}"></a>
|
||||||
<!-- date -->
|
<!-- date -->
|
||||||
{{ if not .Date.IsZero }}
|
{{ if not .Date.IsZero }}
|
||||||
{{ $singlePageDateFormat := .Site.Params.singlePageDateFormat | default "January 2, 2006"}}
|
{{ $singlePageDateFormat := .Site.Params.singlePageDateFormat | default "January 2, 2006"}}
|
||||||
<p class="date">Published on <time class="dt-published" datetime='{{ .Date.Format "2006-01-02T15:04:05Z0700" }}'>{{ .Date.Format $singlePageDateFormat }}</time></p>
|
{{ $pubdate := .Date.Format $singlePageDateFormat }}
|
||||||
<a style="display: none" class="u-url" href="{{ .Permalink }}"></a>
|
<p class="date">Published on <time class="dt-published" datetime='{{ .Date.Format "2006-01-02T15:04:05Z0700" }}'>{{ $pubdate }}</time></p>
|
||||||
|
{{- if .Lastmod }}
|
||||||
|
{{- $lastmod := .Lastmod.Format $singlePageDateFormat }}
|
||||||
|
{{- if ne $lastmod $pubdate }}
|
||||||
|
<p class="date-updated">Updated on <time class='dt-updated' datetime='{{ .Lastmod.Format "2006-01-02T15:04:05Z0700" }}'>{{ $lastmod }}</time></p>
|
||||||
|
{{- end }}
|
||||||
|
{{ end }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
<!-- tags -->
|
<!-- tags -->
|
||||||
<div id="tags">
|
<div id="tags">
|
||||||
|
|
Loading…
Reference in a new issue