fix: update tailwind vite plugin and finalize project
This commit is contained in:
parent
a923cdaabb
commit
fa05359e3f
@ -1,3 +1,7 @@
|
|||||||
Task 1: Astro 基础脚手架已生成
|
Task 1: Astro 基础脚手架已生成
|
||||||
Task 2: Tailwind 官方集成安装完毕
|
Task 2: Tailwind 官方集成安装完毕
|
||||||
Task 3: Typography 插件配置完成
|
Task 3: Typography 插件配置完成
|
||||||
|
Task 4: Markdown 解析底层依赖安装完成
|
||||||
|
Task 5: astro.config.mjs 引擎装配完成
|
||||||
|
Task 7: BaseLayout 闭环
|
||||||
|
Task 8 修正:已通过替换 @tailwindcss/vite 解决配置文件路径问题,构建成功。
|
||||||
|
|||||||
@ -1,16 +1,18 @@
|
|||||||
import { defineConfig } from 'astro/config';
|
import { defineConfig } from 'astro/config';
|
||||||
import tailwind from '@astrojs/tailwind';
|
import tailwind from '@tailwindcss/vite';
|
||||||
import remarkMath from 'remark-math';
|
import remarkMath from 'remark-math';
|
||||||
import rehypeKatex from 'rehype-katex';
|
import rehypeKatex from 'rehype-katex';
|
||||||
import rehypePrettyCode from 'rehype-pretty-code';
|
import rehypePrettyCode from 'rehype-pretty-code';
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
integrations: [tailwind()],
|
vite: {
|
||||||
markdown: {
|
plugins: [tailwind()]
|
||||||
remarkPlugins: [remarkMath],
|
},
|
||||||
rehypePlugins: [
|
markdown: {
|
||||||
rehypeKatex,
|
remarkPlugins: [remarkMath],
|
||||||
[rehypePrettyCode, { theme: 'github-dark' }]
|
rehypePlugins: [
|
||||||
]
|
rehypeKatex,
|
||||||
}
|
[rehypePrettyCode, { theme: 'github-dark' }]
|
||||||
|
]
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
5
src/content/docs/test.md
Normal file
5
src/content/docs/test.md
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
title: "测试文档"
|
||||||
|
---
|
||||||
|
# 标题
|
||||||
|
测试公式:$E=mc^2$
|
||||||
14
src/pages/docs/[...slug].astro
Normal file
14
src/pages/docs/[...slug].astro
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
---
|
||||||
|
import { getCollection, render } from 'astro:content';
|
||||||
|
import BaseLayout from '../../layouts/BaseLayout.astro';
|
||||||
|
|
||||||
|
export async function getStaticPaths() {
|
||||||
|
const docs = await getCollection('docs');
|
||||||
|
return docs.map(doc => ({ params: { slug: doc.id }, props: { doc } }));
|
||||||
|
}
|
||||||
|
const { doc } = Astro.props;
|
||||||
|
const { Content } = await render(doc);
|
||||||
|
---
|
||||||
|
<BaseLayout title={doc.data.title}>
|
||||||
|
<main class="prose dark:prose-invert mx-auto"><Content /></main>
|
||||||
|
</BaseLayout>
|
||||||
Loading…
Reference in New Issue
Block a user