08-27-周三_17-09-29
This commit is contained in:
36
node_modules/gitbook-plugin-tbfed-pagefooter/index.js
generated
vendored
Normal file
36
node_modules/gitbook-plugin-tbfed-pagefooter/index.js
generated
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
var moment = require('moment');
|
||||
module.exports = {
|
||||
book: {
|
||||
assets: './assets',
|
||||
css: [
|
||||
'footer.css'
|
||||
],
|
||||
},
|
||||
hooks: {
|
||||
'page:before': function(page) {
|
||||
var _label = 'File Modify: ',
|
||||
_format = 'YYYY-MM-DD HH:mm:ss',
|
||||
_copy = 'powered by Gitbook'
|
||||
if(this.options.pluginsConfig['tbfed-pagefooter']) {
|
||||
_label = this.options.pluginsConfig['tbfed-pagefooter']['modify_label'] || _label;
|
||||
_format = this.options.pluginsConfig['tbfed-pagefooter']['modify_format'] || _format;
|
||||
|
||||
var _c = this.options.pluginsConfig['tbfed-pagefooter']['copyright'];
|
||||
_copy = _c ? _c + ' all right reserved,' + _copy : _copy;
|
||||
}
|
||||
var _copy = '<span class="copyright">'+_copy+'</span>'
|
||||
var str = ' \n\n<footer class="page-footer">' + _copy +
|
||||
'<span class="footer-modification">' +
|
||||
_label +
|
||||
'\n{{file.mtime | date("' + _format +
|
||||
'")}}\n</span></footer>'
|
||||
page.content = page.content + str;
|
||||
return page;
|
||||
}
|
||||
},
|
||||
filters: {
|
||||
date: function(d, format) {
|
||||
return moment(d).format(format)
|
||||
}
|
||||
}
|
||||
};
|
Reference in New Issue
Block a user