diff options
| author | Xe Iaso <me@xeiaso.net> | 2025-04-25 07:51:02 -0400 |
|---|---|---|
| committer | Xe Iaso <me@xeiaso.net> | 2025-04-25 07:52:13 -0400 |
| commit | bdf48cf3f9a0080cc26a277004043a78d6fd625e (patch) | |
| tree | 962b38ccbea9d0c605009d72434654055d7cb3f3 | |
| parent | f01ec898dfcb671800a50f00635c776cb85a5574 (diff) | |
| download | xesite-bdf48cf3f9a0080cc26a277004043a78d6fd625e.tar.xz xesite-bdf48cf3f9a0080cc26a277004043a78d6fd625e.zip | |
feat(lume): use ISO date format
As requested on the Haiku Discourse:
https://discuss.haiku-os.org/t/fighting-bad-bots-anubis-activated/16650/26?u=xeiaso
| -rw-r--r-- | lume/_config.ts | 2 | ||||
| -rw-r--r-- | lume/src/blog.jsx | 2 | ||||
| -rw-r--r-- | lume/src/talks.jsx | 15 |
3 files changed, 11 insertions, 8 deletions
diff --git a/lume/_config.ts b/lume/_config.ts index de9cae8..93dcd86 100644 --- a/lume/_config.ts +++ b/lume/_config.ts @@ -60,7 +60,7 @@ site.use(jsx_preact()); site.use(attributes()); site.use(date({ formats: { - "DATE_US": "MM/dd/yyyy", + "DATE_US": "yyyy-MM-dd", }, })); site.use(esbuild({ diff --git a/lume/src/blog.jsx b/lume/src/blog.jsx index 137bf66..f121280 100644 --- a/lume/src/blog.jsx +++ b/lume/src/blog.jsx @@ -21,7 +21,7 @@ export default ({ search }, { date }) => { const url = post.redirect_to ? post.redirect_to : post.url; return ( <li> - <time datetime={date(post.date)} className="font-mono">{post.date.toLocaleDateString("en-US", dateOptions)}</time> -{" "} + <time datetime={date(post.date)} className="font-mono">{post.date.toISOString().split('T')[0]}</time> -{" "} <a href={url}>{post.title}</a> </li> ); diff --git a/lume/src/talks.jsx b/lume/src/talks.jsx index 8375684..b519af4 100644 --- a/lume/src/talks.jsx +++ b/lume/src/talks.jsx @@ -9,12 +9,15 @@ export default ({ search }, { date }) => { <ul class="list-disc ml-4 mb-4"> {search.pages("layout=talk.njk", "order date=desc") .filter(post => post.index) - .map((post) => ( - <li> - <time datetime={date(post.date)}>{date(post.date, "DATE_US")}</time> -{" "} - <a href={post.url}>{post.title}</a> - </li> - ))} + .map((post) => { + const url = post.redirect_to ? post.redirect_to : post.url; + return ( + <li> + <time datetime={date(post.date)} className="font-mono">{post.date.toISOString().split('T')[0]}</time> -{" "} + <a href={url}>{post.title}</a> + </li> + ); + })} </ul> </> ); |
