优化性能、逻辑、冗余代码【2.0 版本】✅

This commit is contained in:
Han
2025-03-20 19:23:03 +08:00
parent fae69d44fd
commit d1b781ed6f
66 changed files with 287 additions and 205 deletions
+5 -5
View File
@@ -1,5 +1,5 @@
---
import { getCategoriesList } from "../../utils/getArchive";
import { getCategoriesList } from "@/utils/getArchive";
import { getCollection } from "astro:content";
export async function getStaticPaths(): Promise<any> {
const posts = await getCollection("blog");
@@ -9,14 +9,14 @@ export async function getStaticPaths(): Promise<any> {
const { categories } = Astro.params;
const articleList = await getCategoriesList(categories);
// 页面 Info
import SITE_CONFIG from "../../config";
import SITE_CONFIG from "@/config";
const { Description } = SITE_CONFIG;
// 公共 Layout
import Layout from "../../layouts/Layout.astro";
import Layout from "@/layouts/Layout/Layout.astro";
// Aside组件
import Aside from "../../components/Aside.astro";
import Aside from "@/components/Aside/Aside.astro";
// 文章列表组件
import Archive from "../../components/Archive.astro";
import Archive from "@/components/Archive/Archive.astro";
---
<Layout title={`分类 ${categories} 下的文章`} description={Description}>