mirror of
https://github.com/Brandon-Rozek/website-theme.git
synced 2025-10-09 10:11:14 +00:00
Refactored template code
This commit is contained in:
parent
b28e531f9f
commit
c3e09727a6
20 changed files with 332 additions and 395 deletions
14
layouts/partials/date.html
Normal file
14
layouts/partials/date.html
Normal file
|
@ -0,0 +1,14 @@
|
|||
{{ if not .Date.IsZero }}
|
||||
{{ $publishString := .Scratch.Get "beforeDateString" }}
|
||||
{{ $singlePageDateFormat := .Site.Params.singlePageDateFormat | default "January 2, 2006"}}
|
||||
{{ $pubdate := .Date.Format $singlePageDateFormat }}
|
||||
|
||||
<p class="date">{{ $publishString }}<time class="dt-published" datetime='{{ .Date.Format "2006-01-02T15:04:05Z0700" }}'>{{ $pubdate }}</time></p>
|
||||
|
||||
{{- if and (not (.Scratch.Get "noDateUpdate")) .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 }}
|
Loading…
Add table
Add a link
Reference in a new issue