mirror of
https://github.com/HighCapable/YukiHookAPI.git
synced 2025-09-08 11:34:32 +08:00
Rebuild docsify and delete docs caching code
This commit is contained in:
28
docs/lib/plugins/external-script.js
Normal file
28
docs/lib/plugins/external-script.js
Normal file
@@ -0,0 +1,28 @@
|
||||
(function () {
|
||||
function handleExternalScript() {
|
||||
var container = Docsify.dom.getNode('#main');
|
||||
var scripts = Docsify.dom.findAll(container, 'script');
|
||||
|
||||
for (var i = scripts.length; i--; ) {
|
||||
var script = scripts[i];
|
||||
|
||||
if (script && script.src) {
|
||||
var newScript = document.createElement('script');
|
||||
|
||||
Array.prototype.slice.call(script.attributes).forEach(function (attribute) {
|
||||
newScript[attribute.name] = attribute.value;
|
||||
});
|
||||
|
||||
script.parentNode.insertBefore(newScript, script);
|
||||
script.parentNode.removeChild(script);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var install = function (hook) {
|
||||
hook.doneEach(handleExternalScript);
|
||||
};
|
||||
|
||||
window.$docsify.plugins = [].concat(install, window.$docsify.plugins);
|
||||
|
||||
}());
|
Reference in New Issue
Block a user