📦 theme-classic
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
提示
If you have installed @docusaurus/preset-classic
, you don't need to install it as a dependency.
Configuration
接受的字段:
选项 | 类型 | 默认值 | 描述 |
---|---|---|---|
customCss | string[] | string | [] | Stylesheets to be imported globally as client modules. 相对文件路径会基于站点目录解析。 |
备注
Most configuration for the theme is done in themeConfig
, which can be found in theme configuration.
Example configuration
你可以通过预设选项或插件选项来配置这个主题。
提示
大多数 Docusaurus 用户通过预设选项配置此插件。
- 预设选项
- 插件选项
如果你使用预设,你可以通过预设选项配置这个插件:
docusaurus.config.js
module.exports = {
presets: [
[
'@docusaurus/preset-classic',
{
theme: {
customCss: './src/css/custom.css',
},
},
],
],
};
如果你用的是独立插件,直接向插件提供选项:
docusaurus.config.js
module.exports = {
plugins: [
[
'@docusaurus/theme-classic',
{
customCss: './src/css/custom.css',
},
],
],
};