用于在首页页脚区域添加 icp 网站备案信息的 Gitbook 插件
book.json
文件gitbook
的 book.json
文件中,将 icp
添加到 plugins
列表中。pluginsConfig
,将 number
值设置为您本身的 icp 网站备案编号.pluginsConfig
,label
或 link
值是可选的,默认状况下,连接地址为 http://www.beian.miit.gov.cn/ .这是最简单的示例:git
{ "plugins": ["icp"], "pluginsConfig": { "icp": { "number": "浙ICP备18042346号" } } }
此外,受支持的配置选项以下:github
"label": { "type": "string", "title": "icp label", "required": false }, "number": { "type": "string", "title": "icp number", "required": true }, "link": { "type": "string", "title": "link url", "required": false, "default": "http://www.beian.miit.gov.cn/" }
gitbook install
.它将自动为您的 gitbook
安装 icp
插件.该步骤仅须要容许一次便可.
gitbook install
或者您能够运行 npm install gitbook-plugin-icp
命令本地安装 gitbook-plugin-icp
插件.npm
npm install gitbook-plugin-icp
gitbook build
)或服务( gitbook serve
).gitbook serve
https://github.com/snowdreams1006/gitbook-plugin-icp/blob/master/docs/book.json
{ "plugins": ["icp"], "pluginsConfig": { "icp": { "number": "浙ICP备18042346号" } } }
https://github.com/snowdreams1006/gitbook-plugin-icp/blob/master/example/book.json
{ "plugins": ["icp"], "pluginsConfig": { "icp": { "number": "浙ICP备18042346号" } } }
book.json
文件{ "plugins": ["icp"], "pluginsConfig": { "icp": { "label": "YOUR OWN ICP LABEL", "number": "YOUR OWN ICP NUMBER", "link":"YOUR OWN ICP LINK" } } }
或者,您能够添加 label
以自定义标签:json
{ "plugins": ["icp"], "pluginsConfig": { "icp": { "label": "YOUR OWN ICP LABEL", "number": "YOUR OWN ICP NUMBER", "link":"YOUR OWN ICP LINK" } } }
或者您能够添加 link
以自定义连接:segmentfault
{ "plugins": ["icp"], "pluginsConfig": { "icp": { "label": "YOUR OWN ICP LABEL", "number": "YOUR OWN ICP NUMBER", "link":"YOUR OWN ICP LINK" } } }
注意 :若是您的书尚未建立,以上代码段能够用做完整的book.json
文件.bash
👤 snowdreams1006gitlab
欢迎提供文稿,问题和功能请求!
随时检查问题页面 。网站
若是这个项目对您有帮助,请给个星星 !ui
版权全部©2019 snowdreams1006 。url
该项目是MIT许可的。
若是本文对你有所帮助,不用赞扬,也没必要转发,直接点赞留言告诉鼓励一下就能够啦!