🎨 [enhancement] Add code to display tags & categories in the main blog page
This commit is contained in:
@ -5,8 +5,10 @@ import Layout from '~/layouts/PageLayout.astro';
|
||||
import BlogList from '~/components/blog/List.astro';
|
||||
import Headline from '~/components/blog/Headline.astro';
|
||||
import Pagination from '~/components/blog/Pagination.astro';
|
||||
// import PostTags from "~/components/blog/Tags.astro";
|
||||
|
||||
import { fetchPosts } from '~/utils/blog';
|
||||
// import { findTags, findCategories } from '~/utils/blog';
|
||||
import { BLOG_BASE } from '~/utils/permalinks';
|
||||
|
||||
export async function getStaticPaths({ paginate }) {
|
||||
@ -20,6 +22,9 @@ export async function getStaticPaths({ paginate }) {
|
||||
const { page } = Astro.props;
|
||||
const currentPage = page.currentPage ?? 1;
|
||||
|
||||
// const allCategories = await findCategories();
|
||||
// const allTags = await findTags();
|
||||
|
||||
const meta = {
|
||||
title: `Blog${currentPage > 1 ? ` — Page ${currentPage}` : ''}`,
|
||||
description: SITE.description,
|
||||
@ -37,5 +42,9 @@ const meta = {
|
||||
</Headline>
|
||||
<BlogList posts={page.data} />
|
||||
<Pagination prevUrl={page.url.prev} nextUrl={page.url.next} />
|
||||
<!--
|
||||
<PostTags tags={allCategories} class="mb-2" header="Search by Categories:" />
|
||||
<PostTags tags={allTags} header="Search by Tags:" />
|
||||
-->
|
||||
</section>
|
||||
</Layout>
|
||||
|
Reference in New Issue
Block a user