📦 theme-classic
Docusaurus 的经典主题。
¥The classic theme for Docusaurus.
有关配置的更多详细信息,你可以参考 主题配置页面。
¥You can refer to the theme configuration page for more details on the configuration.
- npm
- Yarn
- pnpm
npm install --save @docusaurus/theme-classic
yarn add @docusaurus/theme-classic
pnpm add @docusaurus/theme-classic
如果你已经安装了 @docusaurus/preset-classic
,则无需将其安装为依赖。
¥If you have installed @docusaurus/preset-classic
, you don't need to install it as a dependency.
配置
¥Configuration
接受的字段:
¥Accepted fields:
选项 | 类型 | 默认 | 描述 |
---|---|---|---|
customCss | string[] | string | [] | 将作为 客户端模块 全局导入的样式表。相对路径根据站点目录进行解析。 |
主题的大部分配置是在 themeConfig
中完成的,可以在 主题配置 中找到。
¥Most configuration for the theme is done in themeConfig
, which can be found in theme configuration.
配置示例
¥Example configuration
你可以通过预设选项或插件选项配置此主题。
¥You can configure this theme through preset options or plugin options.
大多数 Docusaurus 用户通过预设选项配置此插件。
¥Most Docusaurus users configure this plugin through the preset options.
- Preset options
- Plugin options
If you use a preset, configure this plugin through the preset options:
module.exports = {
presets: [
[
'@docusaurus/preset-classic',
{
theme: {
customCss: './src/css/custom.css',
},
},
],
],
};
If you are using a standalone plugin, provide options directly to the plugin:
module.exports = {
plugins: [
[
'@docusaurus/theme-classic',
{
customCss: './src/css/custom.css',
},
],
],
};