Octri

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必填

槽位。

值含义
enabledtrue 或 false
css样式表
headHtml添加到每个页面 head 中的 HTML
bodyEndHtml添加到每个页面 body 末尾的 HTML

示例

显示自定义代码

bash
octri docs custom-code
Output
✔ 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