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 # Meta items
long_date:
other: "{{ .Date.Format `January 2, 2006` }}"
wordcount: wordcount:
one: "{{ . }} word" one: "{{ . }} word"
other: "{{ . }} words" other: "{{ . }} words"

View File

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

View File

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

View File

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