gitbook-plugin-icp
Advanced tools
Comparing version 0.1.2 to 0.2.0
@@ -31,5 +31,5 @@ { | ||
"icp": { | ||
"number":"浙ICP备18042346号" | ||
"label": "© 2009-2021 snowdreams1006.cn 版权所有 ICP证: <a href='https://beian.miit.gov.cn/' target='_blank'>浙ICP备18042346号</a>", | ||
} | ||
} | ||
} |
30
index.js
module.exports = { | ||
hooks: { | ||
"init": function() { | ||
this.log.debug.ln('init', this.options.pluginsConfig['icp']); | ||
}, | ||
"finish": function() { | ||
this.log.debug.ln('finish', this.options.pluginsConfig['icp']); | ||
book: { | ||
assets: './assets', | ||
css: [ | ||
'footer.css' | ||
], | ||
}, | ||
hooks: { | ||
'page:before': function(page) { | ||
var label = '© ' + location.hostname + ' 版权所有 ICP证: '; | ||
var icp = ""; | ||
if(this.options.pluginsConfig['icp']) { | ||
label = this.options.pluginsConfig['icp']['label']; | ||
number = this.options.pluginsConfig['icp']['number']; | ||
if(number && number.trim().length > 0){ | ||
icp = "<a href='"+(this.options.pluginsConfig['icp']['link'])+"' target='_blank'>"+(number)+"</a>"; | ||
} | ||
} | ||
var str = ' \n\n<footer class="page-footer">\n' + label + | ||
icp + | ||
'\n</footer>' | ||
page.content = page.content + str; | ||
return page; | ||
} | ||
}; | ||
} | ||
}; |
{ | ||
"name": "gitbook-plugin-icp", | ||
"version": "0.1.2", | ||
"version": "0.2.0", | ||
"description": "gitbook plugin for adding icp info to footer", | ||
"main": "index.js", | ||
"engines": { | ||
"gitbook": ">=2.5.0" | ||
"gitbook": ">=2.4.3" | ||
}, | ||
@@ -17,3 +17,5 @@ "repository": { | ||
"website", | ||
"supervision" | ||
"supervision", | ||
"footer", | ||
"modification" | ||
], | ||
@@ -36,3 +38,3 @@ "gitbook": { | ||
"required": false, | ||
"default": "http://www.beian.miit.gov.cn/" | ||
"default": "https://beian.miit.gov.cn/" | ||
}, | ||
@@ -39,0 +41,0 @@ "style": { |
@@ -27,7 +27,7 @@ # 欢迎访问 gitbook-plugin-icp 官网 👋 | ||
![icp-multilingual-index-use-preview.png](./icp-multilingual-index-use-preview.png) | ||
![icp-multilingual-index-use-preview.png](icp-multilingual-index-use-preview.png) | ||
- 单语言版本 | ||
![icp-monolingual-index-use-preview.png](./icp-monolingual-index-use-preview.png) | ||
![icp-monolingual-index-use-preview.png](icp-monolingual-index-use-preview.png) | ||
@@ -225,1 +225,5 @@ ## 用法 | ||
该项目是[MIT](https://github.com/snowdreams1006/gitbook-plugin-icp/blob/master/LICENSE)许可的。 | ||
## 感谢 | ||
- [/zhj3618/gitbook-plugin-tbfed-pagefooter](https://github.com/zhj3618/gitbook-plugin-tbfed-pagefooter) |
@@ -27,7 +27,7 @@ # Welcome to gitbook-plugin-icp 👋 | ||
![icp-multilingual-index-use-preview.png](./icp-multilingual-index-use-preview.png) | ||
![icp-multilingual-index-use-preview.png](icp-multilingual-index-use-preview.png) | ||
- monolingual | ||
![icp-monolingual-index-use-preview.png](./icp-monolingual-index-use-preview.png) | ||
![icp-monolingual-index-use-preview.png](icp-monolingual-index-use-preview.png) | ||
@@ -173,3 +173,3 @@ ## Usage | ||
"number": "YOUR OWN ICP NUMBER", | ||
"link": "YOUR OWN ICP LINK" | ||
"link":"YOUR OWN ICP LINK" | ||
} | ||
@@ -220,2 +220,6 @@ } | ||
This project is [MIT](https://github.com/snowdreams1006/gitbook-plugin-icp/blob/master/LICENSE) licensed. | ||
This project is [MIT](https://github.com/snowdreams1006/gitbook-plugin-icp/blob/master/LICENSE) licensed. | ||
## Thanks | ||
- [/zhj3618/gitbook-plugin-tbfed-pagefooter](https://github.com/zhj3618/gitbook-plugin-tbfed-pagefooter) |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
1028635
25
74
222