更换到Astro #9

Merged
biss merged 30 commits from switch-to-astro into master 2026-06-19 13:23:31 +08:00
45 changed files with 9 additions and 6 deletions
Showing only changes of commit 5678b95f6f - Show all commits
@@ -173,7 +173,7 @@ common_col_conf: &common_col_conf
collections: collections:
- name: "2023" - name: "2023"
label: "2023" label: "2023"
folder: "source/_posts/2023" folder: "posts/2023"
preview_path: "2023/{{filename}}/" preview_path: "2023/{{filename}}/"
<<: *common_col_conf <<: *common_col_conf
- name: "pages" - 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 { readdir, readFile, writeFile } from 'node:fs/promises';
import { basename, extname, join, relative } from 'node:path'; 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); const CRC32_TABLE = new Uint32Array(256);
+1 -1
View File
@@ -18,7 +18,7 @@ export type BlogPost = MarkdownModule & {
href: string; 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[] { function asArray(value: unknown): string[] {
if (Array.isArray(value)) return value.map(String).filter(Boolean); 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 BaseLayout from '@/layouts/BaseLayout.astro';
import PageHeaderCard from '@/components/PageHeaderCard.astro'; import PageHeaderCard from '@/components/PageHeaderCard.astro';
import { Content } from '../../source/shuoshuo/index.md'; import TwikooComments from '@/components/TwikooComments.astro';
const title = '说说'; const title = '说说';
const twikooEnvId = 'https://comment.biss.click';
--- ---
<BaseLayout title={title} description="记录日常碎片和灵感的说说页面。"> <BaseLayout title={title} description="记录日常碎片和灵感的说说页面。">
@@ -21,7 +22,9 @@ const title = '说说';
})(); })();
</script> </script>
<div class="shuoshuo-markdown prose"> <div class="shuoshuo-markdown prose">
<Content /> <div id="talk"></div>
</div> </div>
<TwikooComments envId={twikooEnvId} path="/shuoshuo/" title={title} />
<script is:inline src="/js/shuoshuo.js"></script>
</section> </section>
</BaseLayout> </BaseLayout>