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 /lume/src/blog.jsx | |
| 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 'lume/src/blog.jsx')
| -rw-r--r-- | lume/src/blog.jsx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lume/src/blog.jsx b/lume/src/blog.jsx index 9fdd325..cca8869 100644 --- a/lume/src/blog.jsx +++ b/lume/src/blog.jsx @@ -1,7 +1,7 @@ export const title = "Blog Articles"; export const layout = "base.njk"; -export default ({ search }) => { +export default ({ search }, { date }) => { const dateOptions = { year: "numeric", month: "2-digit", day: "2-digit" }; return ( @@ -19,7 +19,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">{post.data.date.toLocaleDateString("en-US", dateOptions)}</time> -{" "} <a href={url}>{post.data.title}</a> </li> ); |
