mirror of
https://github.com/KazooTTT/kazoottt-blog-v2.git
synced 2025-06-16 15:31:21 +08:00
feat: 显示标签和分类的数量
This commit is contained in:
@ -4,6 +4,7 @@ import PageLayout from "@/layouts/Base.astro";
|
||||
|
||||
const allPosts = await getAllPosts();
|
||||
const allCategories = getUniqueCategoriesWithCount(allPosts);
|
||||
const count = allCategories.length;
|
||||
|
||||
const meta = {
|
||||
description: "A list of all the categories I've written about in my posts",
|
||||
@ -12,7 +13,7 @@ const meta = {
|
||||
---
|
||||
|
||||
<PageLayout meta={meta}>
|
||||
<h1 class="title mb-6">Categories</h1>
|
||||
<h1 class="title mb-6">Categories({count})</h1>
|
||||
<ul class="space-y-4">
|
||||
{
|
||||
allCategories.map(([item, val]) => (
|
||||
|
@ -4,6 +4,7 @@ import PageLayout from "@/layouts/Base.astro";
|
||||
|
||||
const allPosts = await getAllPosts();
|
||||
const allTags = getUniqueTagsWithCount(allPosts);
|
||||
const count = allTags.length;
|
||||
|
||||
const meta = {
|
||||
description: "A list of all the topics I've written about in my posts",
|
||||
@ -12,7 +13,7 @@ const meta = {
|
||||
---
|
||||
|
||||
<PageLayout meta={meta}>
|
||||
<h1 class="title mb-6">Tags</h1>
|
||||
<h1 class="title mb-6">Tags({count})</h1>
|
||||
<ul class="space-y-4">
|
||||
{
|
||||
allTags.map(([tag, val]) => (
|
||||
|
Reference in New Issue
Block a user