This commit is contained in:
2026-01-16 14:32:54 +08:00
parent e8f4e7880a
commit 58fc5b8936
6 changed files with 49 additions and 8 deletions

View File

@@ -1,4 +1,6 @@
<script lang="ts" setup>
import siteConfig from "~/config";
// import type { BlogPost } from "@/types/blog";
const route = useRoute();
@@ -39,11 +41,17 @@ const formattedData = computed(() => {
});
useHead({
title: `Category: ${category.value}`,
title: `Category -${siteConfig} ${category.value}`,
meta: [
{
name: "description",
content: `You will find all the ${category.value} related post here`,
content: `你可以在这里找到所有关于 ${category.value} 的文章。`,
},
],
link: [
{
rel: "canonical",
href: `${siteConfig.siteMeta.url}/${route.path}`,
},
],
});

View File

@@ -1,4 +1,7 @@
<script lang="ts" setup>
import siteConfig from "~/config";
const { path } = useRoute();
const { data } = await useAsyncData("all-blog-post-by-category", () =>
queryCollection("content").select("path", "categories").where("published", "=", true).all(),
);
@@ -18,13 +21,19 @@ data.value?.forEach((blog) => {
});
useHead({
title: "Categories",
title: `Categories - ${siteConfig.siteMeta.title}`,
meta: [
{
name: "description",
content: "以下列出了我撰写的文章主题。",
},
],
link: [
{
rel: "canonical",
href: `${siteConfig.siteMeta.url}/${path}`,
},
],
});
</script>