refactor: Improve layout and styling across multiple components

This commit is contained in:
KazooTTT
2025-02-08 18:32:57 +08:00
parent 1653e679fc
commit 8e8dc71801
9 changed files with 17 additions and 25 deletions

View File

@ -15,7 +15,7 @@ export const getStaticPaths: GetStaticPaths = async ({ paginate }) => {
return uniqueCategories.flatMap((category) => {
const filterPosts = sortedPosts.filter((post) => post.data.category === category);
return paginate(filterPosts, {
pageSize: 10,
pageSize: 20,
params: { category },
});
});

View File

@ -12,7 +12,7 @@ export const getStaticPaths: GetStaticPaths = async ({ paginate }) => {
return uniqueCategories.flatMap((category) => {
const filterPosts = sortedPosts.filter((post) => post.data.category === category);
return paginate(filterPosts, {
pageSize: 10,
pageSize: 20,
params: { category },
});
});

View File

@ -85,12 +85,14 @@ const descYearKeys = Object.keys(groupedByYear).sort((a, b) => +b - +a);
<Pagination {...paginationProps} />
</div>
<aside class="flex flex-col gap-2">
<aside class="flex flex-col gap-8">
{
!!uniqueTags.length && (
<div>
<h2 class="title mb-4 flex items-center gap-2 text-lg">
Tags
<a href="/tags/" class="hover:text-link cactus-link">
Tags
</a>
<svg
aria-hidden="true"
class="h-6 w-6"
@ -119,12 +121,6 @@ const descYearKeys = Object.keys(groupedByYear).sort((a, b) => +b - +a);
</li>
))}
</ul>
<span class="mt-4 block sm:text-end">
<a class="hover:text-link" href="/tags/">
View all <span aria-hidden="true">→</span>
<span class="sr-only">blog tags</span>
</a>
</span>
</div>
)
}
@ -133,7 +129,9 @@ const descYearKeys = Object.keys(groupedByYear).sort((a, b) => +b - +a);
!!uniqueCategories.length && (
<div>
<h2 class="title mb-4 flex items-center gap-2 text-lg">
Categories
<a href="/categories/" class="hover:text-link cactus-link">
Categories
</a>
<svg
aria-hidden="true"
class="h-6 w-6"
@ -165,12 +163,6 @@ const descYearKeys = Object.keys(groupedByYear).sort((a, b) => +b - +a);
</li>
))}
</ul>
<span class="mt-4 block sm:text-end">
<a class="hover:text-link" href="/categories/">
View all <span aria-hidden="true">→</span>
<span class="sr-only">blog categories</span>
</a>
</span>
</div>
)
}

View File

@ -12,7 +12,7 @@ export const getStaticPaths: GetStaticPaths = async ({ paginate }) => {
return uniqueTags.flatMap((tag) => {
const filterPosts = sortedPosts.filter((post) => post.data.tags.includes(tag));
return paginate(filterPosts, {
pageSize: 10,
pageSize: 20,
params: { tag },
});
});

View File

@ -15,7 +15,7 @@ export const getStaticPaths: GetStaticPaths = async ({ paginate }) => {
return uniqueTags.flatMap((tag) => {
const filterPosts = sortedPosts.filter((post) => post.data.tags.includes(tag));
return paginate(filterPosts, {
pageSize: 10,
pageSize: 20,
params: { tag },
});
});