gitbook-plugin-icp
Advanced tools
Comparing version 0.0.4 to 0.0.5
26
index.js
var fs = require('fs'); | ||
var path = require('path'); | ||
var cheerio = require('cheerio'); | ||
module.exports = { | ||
@@ -11,10 +14,23 @@ hooks: { | ||
var indexPath = path.join(process.cwd(), '_book', 'index.html'); | ||
console.log("number="+number+",indexPath="+indexPath); | ||
var multilingual = this.isLanguageBook(); | ||
// if (number && fs.existsSync(indexPath)) { | ||
// fs.createReadStream(indexPath).pipe(fs.createWriteStream(indexPath)); | ||
// } | ||
console.log("number="+number+",indexPath="+indexPath+",multilingual="+multilingual); | ||
if (multilingual && number && fs.existsSync(indexPath)) { | ||
var indexText = fs.readFileSync(indexPath); | ||
indexText = indexText.toString(); | ||
console.log(indexText); | ||
$ = cheerio.load(indexText); | ||
var str ='<div style="position: absolute;bottom: 0;left: 50%;transform: translate(-50%, -50%);">ICP证:<a href="http://beian.miit.gov.cn/" target="_blank" style="color:#f72b07">浙ICP备18042346号</a></div>'; | ||
$('body').append(str); | ||
indexText = $.html(); | ||
console.log(indexText); | ||
fs.writeFileSync(indexPath,indexText); | ||
} | ||
} | ||
} | ||
}; |
{ | ||
"name": "gitbook-plugin-icp", | ||
"version": "0.0.4", | ||
"version": "0.0.5", | ||
"description": "gitbook plugin for adding icp info to footer", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
430921
24