Initial rewrite
This commit is contained in:
parent
a5f64a3ff8
commit
0d183c8335
200 changed files with 12537 additions and 18659 deletions
32
src/pages/articles/index.astro
Normal file
32
src/pages/articles/index.astro
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
---
|
||||
import ArticleList from '../../components/ArticleList.astro';
|
||||
import TagList from '../../components/TagList.astro';
|
||||
import Page from '../../layouts/Page.astro';
|
||||
import { getAllTags, getPublishedPosts, yearOf } from '../../lib/site';
|
||||
|
||||
const posts = await getPublishedPosts();
|
||||
const years = [...new Set(posts.map((post) => yearOf(post.data.date)))];
|
||||
const tags = getAllTags(posts);
|
||||
---
|
||||
|
||||
<Page
|
||||
title="Articles"
|
||||
description="Technical articles and notes about projects, systems, AI deployment, graphics, simulations, and tools."
|
||||
>
|
||||
<nav class="tag-filter" aria-label="Filter articles by tag">
|
||||
<span>Filter by tag</span>
|
||||
<TagList tags={tags} />
|
||||
</nav>
|
||||
|
||||
{
|
||||
years.map((year) => {
|
||||
const postsForYear = posts.filter((post) => yearOf(post.data.date) === year);
|
||||
return (
|
||||
<section class="archive-year" aria-labelledby={`year-${year}`}>
|
||||
<h2 id={`year-${year}`}>{year}</h2>
|
||||
<ArticleList posts={postsForYear} showYear />
|
||||
</section>
|
||||
);
|
||||
})
|
||||
}
|
||||
</Page>
|
||||
Loading…
Add table
Add a link
Reference in a new issue