优化文件结构

This commit is contained in:
2026-06-18 21:22:17 +08:00 Unverified
parent d98d2989cb
commit 5678b95f6f
45 changed files with 9 additions and 6 deletions
@@ -173,7 +173,7 @@ common_col_conf: &common_col_conf
collections:
- name: "2023"
label: "2023"
folder: "source/_posts/2023"
folder: "posts/2023"
preview_path: "2023/{{filename}}/"
<<: *common_col_conf
- name: "pages"
@@ -214,4 +214,4 @@ collections:
# 大功告成
访问博客的admin就可以了
访问博客的admin就可以了
+1 -1
View File
@@ -1,7 +1,7 @@
import { readdir, readFile, writeFile } from 'node:fs/promises';
import { basename, extname, join, relative } from 'node:path';
const POSTS_DIR = join(process.cwd(), 'source', '_posts');
const POSTS_DIR = join(process.cwd(), 'posts');
const CRC32_TABLE = new Uint32Array(256);
+1 -1
View File
@@ -18,7 +18,7 @@ export type BlogPost = MarkdownModule & {
href: string;
};
const modules = import.meta.glob<MarkdownModule>('/source/_posts/**/*.md', { eager: true });
const modules = import.meta.glob<MarkdownModule>('/posts/**/*.md', { eager: true });
function asArray(value: unknown): string[] {
if (Array.isArray(value)) return value.map(String).filter(Boolean);
+5 -2
View File
@@ -1,9 +1,10 @@
---
import BaseLayout from '@/layouts/BaseLayout.astro';
import PageHeaderCard from '@/components/PageHeaderCard.astro';
import { Content } from '../../source/shuoshuo/index.md';
import TwikooComments from '@/components/TwikooComments.astro';
const title = '说说';
const twikooEnvId = 'https://comment.biss.click';
---
<BaseLayout title={title} description="记录日常碎片和灵感的说说页面。">
@@ -21,7 +22,9 @@ const title = '说说';
})();
</script>
<div class="shuoshuo-markdown prose">
<Content />
<div id="talk"></div>
</div>
<TwikooComments envId={twikooEnvId} path="/shuoshuo/" title={title} />
<script is:inline src="/js/shuoshuo.js"></script>
</section>
</BaseLayout>