docs custom-code
显示自定义代码是否已启用,以及每个槽位可容纳多少 CSS 和 HTML。--json 会打印代码本身。没有草稿:命令返回后,更改会立即在你的文档网站上线,与在 API Studio 中保存效果相同。请参阅自定义代码。
bash
octri docs custom-code [show | set key=value …]octri docs custom-code set key=value …
设置网站加载的代码,通常通过 @ 从文件读取。只有启用自定义代码后,保存的代码才会显示给读者,因此如果 enabled 仍为 false,命令会提醒你。
参数
key=valuestring必填槽位。
| 值 | 含义 |
|---|---|
enabled | true 或 false |
css | 样式表 |
headHtml | 添加到每个页面 head 中的 HTML |
bodyEndHtml | 添加到每个页面 body 末尾的 HTML |
示例
显示自定义代码
bash
octri docs custom-codeOutput
✔ Loading custom code
Custom code off
css empty
headHtml empty
bodyEndHtml empty
--json prints the code itself加载样式表
bash
octri docs custom-code set css=@docs.css enabled=true相关内容
octri docs theme:读取和更改外观:颜色、徽标、字体、布局和代码主题。octri docs components:推送、显示和移除页面使用的自定义组件。