Improve date element in page metadata

This commit is contained in:
BBaoVanC 2023-04-06 00:08:28 -05:00
parent 7bc8a4cb57
commit 17047babc0
Signed by: bbaovanc
GPG Key ID: 18089E4E3CCF1D3A
4 changed files with 6 additions and 12 deletions

View File

@ -19,9 +19,6 @@ copy_to_clipboard:
# Meta items
long_date:
other: "{{ .Date.Format `January 2, 2006` }}"
wordcount:
one: "{{ . }} word"
other: "{{ . }} words"

View File

@ -3,9 +3,7 @@
{{ if .Date }}
<span class="page-metadata-item" aria-label="{{ i18n "aria_post_meta_date" }}">
{{ partial "icon.html" "calendar" }}
<time datetime="{{ .Date.Format "2006-01-02" }}" pubdate>
{{ i18n "long_date" (dict "Date" .Date "Data" .Site.Data) }}
</time>
{{ partial "time-element.html" .Date }}
</span>
{{/* TODO: make this be a tooltip */}}
@ -13,9 +11,7 @@
{{ if ne (time.Format "2006-01-02" .Lastmod) (time.Format "2006-01-02" .Date) }}
<span class="page-metadata-item" aria-label="{{ i18n "aria_post_meta_modified_date" }}">
{{ partial "icon.html" "pencil" }}
<time datetime="{{ .Lastmod.Format "2006-01-02" }}" pubdate>
{{ i18n "long_date" (dict "Date" .Lastmod "Data" .Site.Data) }}
</time>
{{ partial "time-element.html" .Lastmod }}
{{ end }}
</span>
*/}}

View File

@ -3,9 +3,7 @@
{{ if .Date }}
<span class="page-metadata-item" aria-label="date">
{{ partial "icon.html" "calendar" }}
<time datetime="{{ .Date.Format "2006-01-02" }}" pubdate>
{{ i18n "long_date" (dict "Date" .Date "Data" .Site.Data) }}
</time>
{{ partial "time-element.html" .Date }}
</span>
{{ end }}

View File

@ -0,0 +1,3 @@
<time datetime="{{ .Format "2006-01-02T15:04:05Z07:00" }}" title="{{ . }}">
{{ .Format "January 2, 2006" }}
</time>