📦 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 用户通过预设选项配置此插件。
- Preset options
- Plugin options
If you use a preset, configure this plugin through the preset options:
docusaurus.config.js
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:
docusaurus.config.js
module.exports = {
plugins: [
[
'@docusaurus/theme-classic',
{
customCss: './src/css/custom.css',
},
],
],
};