The code and data behind xeiaso.net
5
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

+11 -8
+1 -1
lume/_config.ts
··· 60 60 site.use(attributes()); 61 61 site.use(date({ 62 62 formats: { 63 - "DATE_US": "MM/dd/yyyy", 63 + "DATE_US": "yyyy-MM-dd", 64 64 }, 65 65 })); 66 66 site.use(esbuild({
+1 -1
lume/src/blog.jsx
··· 21 21 const url = post.redirect_to ? post.redirect_to : post.url; 22 22 return ( 23 23 <li> 24 - <time datetime={date(post.date)} className="font-mono">{post.date.toLocaleDateString("en-US", dateOptions)}</time> -{" "} 24 + <time datetime={date(post.date)} className="font-mono">{post.date.toISOString().split('T')[0]}</time> -{" "} 25 25 <a href={url}>{post.title}</a> 26 26 </li> 27 27 );
+9 -6
lume/src/talks.jsx
··· 9 9 <ul class="list-disc ml-4 mb-4"> 10 10 {search.pages("layout=talk.njk", "order date=desc") 11 11 .filter(post => post.index) 12 - .map((post) => ( 13 - <li> 14 - <time datetime={date(post.date)}>{date(post.date, "DATE_US")}</time> -{" "} 15 - <a href={post.url}>{post.title}</a> 16 - </li> 17 - ))} 12 + .map((post) => { 13 + const url = post.redirect_to ? post.redirect_to : post.url; 14 + return ( 15 + <li> 16 + <time datetime={date(post.date)} className="font-mono">{post.date.toISOString().split('T')[0]}</time> -{" "} 17 + <a href={url}>{post.title}</a> 18 + </li> 19 + ); 20 + })} 18 21 </ul> 19 22 </> 20 23 );