parent
6148feb120
commit
03016cadbc
@ -0,0 +1,27 @@
|
|||||||
|
const path = require("path");
|
||||||
|
|
||||||
|
function pluginWwads() {
|
||||||
|
return {
|
||||||
|
name: "docusaurus-plugin-wwads",
|
||||||
|
|
||||||
|
getClientModules() {
|
||||||
|
return [path.resolve(__dirname, "./wwads")];
|
||||||
|
},
|
||||||
|
|
||||||
|
injectHtmlTags() {
|
||||||
|
return {
|
||||||
|
headTags: [
|
||||||
|
{
|
||||||
|
tagName: "script",
|
||||||
|
attributes: {
|
||||||
|
async: true,
|
||||||
|
src: `https://cdn.wwads.cn/js/makemoney.js`,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
},
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
exports.default = pluginWwads;
|
@ -0,0 +1,20 @@
|
|||||||
|
import ExecutionEnvironment from "@docusaurus/ExecutionEnvironment";
|
||||||
|
|
||||||
|
export default (function () {
|
||||||
|
if (!ExecutionEnvironment.canUseDOM) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
onRouteUpdate() {
|
||||||
|
setTimeout(() => {
|
||||||
|
const ad = document.getElementsByClassName("table-of-contents");
|
||||||
|
const adnode = document.createElement("div");
|
||||||
|
adnode.setAttribute("class", "wwads-cn wwads-vertical");
|
||||||
|
adnode.setAttribute("data-id", "80");
|
||||||
|
adnode.setAttribute("style", "max-width:200px");
|
||||||
|
ad[0].parentNode.appendChild(adnode);
|
||||||
|
}, 2000);
|
||||||
|
},
|
||||||
|
};
|
||||||
|
})();
|
Loading…
Reference in new issue