配置
本页聚焦 docs.config.ts,说明它在 Squidoc 项目中的工作方式。
你将配置什么
你将学习如何定义站点元数据、docs 基础路径、主题、插件和导航。
发布前检查
修改导航或插件后运行 squidoc check,尽早发现缺失路由。
相关阅读
示例
import { defineConfig } from "squidoc";
export default defineConfig({
site: {
name: "My Docs",
url: "https://docs.example.com",
description: "Documentation powered by Squidoc",
},
docs: {
basePath: "/docs",
},
theme: {
name: "@squidoc/theme-basic",
options: {
headerLinks: [{ title: "GitHub", href: "https://github.com/Squidoc/Squidoc" }],
footer: {
text: "Built with Squidoc.",
links: [
{ title: "GitHub", href: "https://github.com/Squidoc/Squidoc" },
{ title: "Configuration", path: "/docs/configuration" },
],
},
},
},
plugins: [
"@squidoc/plugin-seo",
"@squidoc/plugin-pages",
"@squidoc/plugin-codeblocks",
"@squidoc/plugin-article-tree",
],
nav: [
{ title: "Introduction", path: "/" },
{ title: "Getting Started", path: "/getting-started" },
{ title: "Configuration", path: "/configuration" },
{ title: "Sidebar Navigation", path: "/navigation" },
{
title: "Customization",
items: [
{ title: "Plugins", path: "/plugins" },
{ title: "Themes", path: "/themes" },
],
},
{
title: "Authoring Extensions",
path: "/developers",
items: [
{ title: "Plugin Authoring", path: "/plugin-authoring" },
{ title: "Theme Authoring", path: "/theme-authoring" },
],
},
],
});
npx squidoc add plugin @squidoc/plugin-search
npx squidoc add theme @squidoc/theme-basic
plugins: [
{
name: "@acme/squidoc-plugin-example",
options: {
message: "Generated from plugin options.",
},
},
];