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,15 +1,23 @@
<script lang="ts" setup>
import Fuse from "fuse.js";
import { formatDate } from "~/utils/helper";
import siteConfig from "~/config";
const { path } = useRoute();
useHead({
title: "Archive",
title: `Archive - ${siteConfig.siteMeta.title}`,
meta: [
{
name: "description",
content: "浏览所有已发布的文章,轻松找到您感兴趣的内容。",
},
],
link: [
{
rel: "canonical",
href: `${siteConfig.siteMeta.url}/${path}`,
},
],
});
const { data } = await useAsyncData("all-archive-post", () =>

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>

View File

@@ -6,7 +6,7 @@
<MainHero />
<div class="relative">
<div class="container max-w-7xl mx-auto text-zinc-600 px-4 py-8 relative z-10">
<div class="container flex max-w-7xl mx-auto text-zinc-600 px-4 py-8 relative z-10">
<MainRecent />
</div>
</div>

View File

@@ -1,4 +1,5 @@
<script lang="ts" setup>
import siteConfig from "~/config";
const route = useRoute();
const tag = computed(() => {
@@ -40,11 +41,17 @@ const formattedData = computed(() => {
});
useHead({
title: `Tag: ${tag.value}`,
title: `Tag - ${siteConfig.siteMeta.title}: ${tag.value}`,
meta: [
{
name: "description",
content: `Explore all posts tagged with ${tag.value}`,
content: `你可以在这里找到所有关于 ${tag.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-tags", () =>
queryCollection("content").select("path", "tags").where("published", "=", true).all(),
);
@@ -18,13 +21,19 @@ data.value?.forEach((blog) => {
});
useHead({
title: "Tags",
title: `Tags - ${siteConfig.siteMeta.title}`,
meta: [
{
name: "description",
content: "浏览所有我写过的文章的标签。",
},
],
link: [
{
rel: "canonical",
href: `${siteConfig.siteMeta.url}/${path}`,
},
],
});
</script>