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 2: Tailwind 官方集成安装完毕
|
||||
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 tailwind from '@astrojs/tailwind';
|
||||
import tailwind from '@tailwindcss/vite';
|
||||
import remarkMath from 'remark-math';
|
||||
import rehypeKatex from 'rehype-katex';
|
||||
import rehypePrettyCode from 'rehype-pretty-code';
|
||||
|
||||
export default defineConfig({
|
||||
integrations: [tailwind()],
|
||||
markdown: {
|
||||
remarkPlugins: [remarkMath],
|
||||
rehypePlugins: [
|
||||
rehypeKatex,
|
||||
[rehypePrettyCode, { theme: 'github-dark' }]
|
||||
]
|
||||
}
|
||||
vite: {
|
||||
plugins: [tailwind()]
|
||||
},
|
||||
markdown: {
|
||||
remarkPlugins: [remarkMath],
|
||||
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