1
0
Fork 0
mirror of https://git.sr.ht/~seirdy/seirdy.one synced 2024-11-10 00:12:09 +00:00

Use a sane date format

ISO 8601 and RFC 3339 are the correct date formats.
The other date formats are incorrect.
This commit is contained in:
rohan kumar 2020-11-25 22:17:58 -08:00
parent 8e38c66243
commit 25ffbd9bbb
No known key found for this signature in database
GPG key ID: 1E892DB2A5F84479
2 changed files with 3 additions and 2 deletions

View file

@ -3,7 +3,7 @@
<header id="post-header"> <header id="post-header">
<h1>{{ .Title }}</h1> <h1>{{ .Title }}</h1>
{{- if isset .Params "date" -}} {{- if isset .Params "date" -}}
<time>{{ .Date.Format "January 2, 2006" }}</time> <time datetime="{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}">{{ .Date.Format "2006-01-02" }}</time>
{{- end -}} {{- end -}}
</header> </header>
{{- .Content -}} {{- .Content -}}

View file

@ -1,8 +1,9 @@
<h3>Posts</h3> <h3>Posts</h3>
<p><em>Timestamp format: <code>YYYY-MM-DD</code>, as per <a href="https://www.ietf.org/rfc/rfc3339.txt">RFC 3339</a> and <a href="https://xkcd.com/1179/">ISO 8601</a></em></p>
<ul id="posts"> <ul id="posts">
{{- range where site.RegularPages "Type" "in" site.Params.mainSections }} {{- range where site.RegularPages "Type" "in" site.Params.mainSections }}
<li> <li>
<time>{{ .Date.Format "Jan 2, 2006" }}</time> <time datetime="{{ .Date.Format "2006-01-02 15:04:05Z07:00" }}">{{ .Date.Format "2006-01-02" }}</time>
<br> <br>
<a href="{{ .Permalink }}"> <a href="{{ .Permalink }}">
{{ .Title }} {{ .Title }}