优化性能、逻辑、冗余代码【2.0 版本】✅
This commit is contained in:
@@ -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}>
|
||||
|
||||
Reference in New Issue
Block a user