website/blog/index.tsx
Foster Hangdaan b7bc906545
Switch to S3 bucket for static assets
This replaces all asset links to use the new public S3 bucket. It also
upgrades several packages:

- Simple Icons v10.2.0 to v13.9.0
- Tabler Icons v2.47.0 to v3.14.0
- HightightJS v11.9.0 to v11.10.0
- Monaspace v1.000 to v1.101
2024-09-08 10:45:36 -04:00

39 lines
1,021 B
TypeScript

export const title = "Blog";
export const description = "Hello, stranger. Stay a while and listen.";
export default function ({ nav, comp }: Lume.Data) {
const { PostListItem } = comp;
if (!nav.menu("/blog/posts")) {
return (
<div className="no-posts">
<img
src="https://minio.fosterhangdaan.com/public/images/icons/tabler-icons/3.14.0/outline/coffee.svg"
className="icon"
alt=""
/>
<h2>No posts yet</h2>
<p>
Foster is on a coffee break.<br />Check back later.
</p>
</div>
);
}
return (
<ul className="post-list">
{nav.menu("/blog/posts")?.children?.sort((a, b) => {
let result = 0;
if (a.data && b.data) {
if (a.data.date < b.data.date) {
result = 1;
} else if (a.data.date > b.data.date) {
result = -1;
}
}
return result;
}).map((post, index) => <PostListItem key={index} post={post} />)}
</ul>
);
}