08-27-周三_17-09-29
This commit is contained in:
26
node_modules/gitbook-plugin-sharing-plus/index.js
generated
vendored
Normal file
26
node_modules/gitbook-plugin-sharing-plus/index.js
generated
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
var _ = require('lodash');
|
||||
|
||||
module.exports = {
|
||||
book: {
|
||||
assets: './assets',
|
||||
js: [
|
||||
'buttons.js'
|
||||
]
|
||||
},
|
||||
hooks: {
|
||||
// Compatibility layer for gitbook < 2.5.0
|
||||
config: function(cfg) {
|
||||
var sharingLink = _.get(cfg, 'links.sharing', {});
|
||||
cfg.pluginsConfig.sharing = _.defaults(cfg.pluginsConfig.sharing || {}, {});
|
||||
|
||||
_.each(sharingLink, function(enabled, type) {
|
||||
if (enabled != false) return;
|
||||
|
||||
if (type == 'all') cfg.pluginsConfig.sharing[type] = [];
|
||||
else cfg.pluginsConfig.sharing[type] = false;
|
||||
});
|
||||
|
||||
return cfg;
|
||||
}
|
||||
}
|
||||
};
|
Reference in New Issue
Block a user