diff options
| author | scarf <greenscarf005@gmail.com> | 2024-01-29 03:23:15 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-01-28 13:23:15 -0500 |
| commit | a16146721f79e3ae30f59ed6515bbbf3ccb8dbcf (patch) | |
| tree | af60e71aaa58190f06f376622747a7fac6fbdcda /internal/lume | |
| parent | 95d775d4d8e6c3d3204ad6360ea29fb6dff53a2c (diff) | |
| download | xesite-a16146721f79e3ae30f59ed6515bbbf3ccb8dbcf.tar.xz xesite-a16146721f79e3ae30f59ed6515bbbf3ccb8dbcf.zip | |
feat: use time tag for date (#760)
* feat: use `time` tag
* refactor: use `DATE_US` filter
Diffstat (limited to 'internal/lume')
| -rw-r--r-- | internal/lume/lume.go | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/internal/lume/lume.go b/internal/lume/lume.go index c605279..7a966c0 100644 --- a/internal/lume/lume.go +++ b/internal/lume/lume.go @@ -431,9 +431,7 @@ const seriesPageTemplateStr = `export const title = "{{.Series}}"; export const layout = "base.njk"; export const date = "2012-01-01"; -export default ({ search }) => { - const dateOptions = { year: "numeric", month: "2-digit", day: "2-digit" }; - +export default ({ search }, { date }) => { return ( <div> <h1 className="text-3xl mb-4">{title}</h1> @@ -446,7 +444,7 @@ export default ({ search }) => { const url = post.data.redirect_to ? post.data.redirect_to : post.data.url; return ( <li> - <span className="font-mono">{post.data.date.toLocaleDateString("en-US", dateOptions)}</span> -{" "} + <time datetime={date(post.data.date)} className="font-mono">{date(post.data.date, "DATE_US")}</time> -{" "} <a href={url}>{post.data.title}</a> </li> ); |
