hexo-theme-gnix 6.0.3 → 6.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/layout/common/head.jsx
CHANGED
|
@@ -125,7 +125,10 @@ module.exports = class extends Component {
|
|
|
125
125
|
|
|
126
126
|
return (
|
|
127
127
|
<head>
|
|
128
|
-
<script
|
|
128
|
+
<script
|
|
129
|
+
data-swup-ignore-script
|
|
130
|
+
dangerouslySetInnerHTML={{ __html: themeInitScript }}
|
|
131
|
+
></script>
|
|
129
132
|
<meta charset="utf-8" />
|
|
130
133
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
131
134
|
{noIndex ? <meta name="robots" content="noindex" /> : null}
|
|
@@ -217,7 +220,7 @@ module.exports = class extends Component {
|
|
|
217
220
|
onload="this.onload=null;this.rel='stylesheet'"
|
|
218
221
|
/>
|
|
219
222
|
{/* Maple Mono CN */}
|
|
220
|
-
<link rel="preconnect" href="https://fontsapi.zeoseven.com"/>
|
|
223
|
+
<link rel="preconnect" href="https://fontsapi.zeoseven.com" />
|
|
221
224
|
<link
|
|
222
225
|
rel="preload"
|
|
223
226
|
as="style"
|
|
@@ -234,6 +237,7 @@ module.exports = class extends Component {
|
|
|
234
237
|
/>
|
|
235
238
|
{adsenseClientId ? (
|
|
236
239
|
<script
|
|
240
|
+
data-swup-ignore-script
|
|
237
241
|
data-ad-client={adsenseClientId}
|
|
238
242
|
src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"
|
|
239
243
|
async
|
|
@@ -17,17 +17,28 @@ module.exports = class extends Component {
|
|
|
17
17
|
/>
|
|
18
18
|
<Swup head={false} />
|
|
19
19
|
<script
|
|
20
|
+
data-swup-ignore-script
|
|
20
21
|
defer
|
|
21
22
|
src="/js/host/iconify-icon/3.0.2/iconify-icon.min.js"
|
|
22
23
|
></script>
|
|
23
|
-
<script defer src="/js/theme-selector.js"></script>
|
|
24
24
|
<script
|
|
25
|
+
data-swup-ignore-script
|
|
26
|
+
defer
|
|
27
|
+
src="/js/theme-selector.js"
|
|
28
|
+
></script>
|
|
29
|
+
<script
|
|
30
|
+
data-swup-ignore-script
|
|
25
31
|
defer
|
|
26
32
|
src="/js/host/medium-zoom/dist/medium-zoom.min.js"
|
|
27
33
|
></script>
|
|
28
|
-
<script defer src="/js/mdit/shiki.js"></script>
|
|
29
|
-
<script defer src="/js/main.js"></script>
|
|
30
|
-
<script
|
|
34
|
+
<script data-swup-ignore-script defer src="/js/mdit/shiki.js"></script>
|
|
35
|
+
<script data-swup-ignore-script defer src="/js/main.js"></script>
|
|
36
|
+
<script
|
|
37
|
+
data-swup-ignore-script
|
|
38
|
+
async
|
|
39
|
+
src="/js/instant-page.min.js"
|
|
40
|
+
type="module"
|
|
41
|
+
></script>
|
|
31
42
|
</Fragment>
|
|
32
43
|
);
|
|
33
44
|
}
|
package/layout/plugin/swup.jsx
CHANGED
|
@@ -14,7 +14,8 @@ const swup = new Swup({
|
|
|
14
14
|
plugins: [
|
|
15
15
|
new SwupHeadPlugin({
|
|
16
16
|
persistTags: true
|
|
17
|
-
})
|
|
17
|
+
}),
|
|
18
|
+
new SwupScriptsPlugin()
|
|
18
19
|
]
|
|
19
20
|
});
|
|
20
21
|
`;
|
|
@@ -22,7 +23,11 @@ const swup = new Swup({
|
|
|
22
23
|
<Fragment>
|
|
23
24
|
<script src="/js/host/swup/Swup.umd.min.js"></script>
|
|
24
25
|
<script src="/js/host/swup/head-plugin.umd.min.js"></script>
|
|
25
|
-
<script
|
|
26
|
+
<script src="/js/host/swup/scripts-plugin.umd.min.js"></script>
|
|
27
|
+
<script
|
|
28
|
+
data-swup-ignore-script
|
|
29
|
+
dangerouslySetInnerHTML={{ __html: swupScript }}
|
|
30
|
+
></script>
|
|
26
31
|
</Fragment>
|
|
27
32
|
);
|
|
28
33
|
}
|
package/package.json
CHANGED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t||self).SwupScriptsPlugin=e()}(this,function(){function t(){return t=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},t.apply(this,arguments)}const e=t=>String(t).split(".").map(t=>String(parseInt(t||"0",10))).concat(["0","0"]).slice(0,3).join(".");class n{constructor(){this.isSwupPlugin=!0,this.swup=void 0,this.version=void 0,this.requires={},this.handlersToUnregister=[]}mount(){}unmount(){this.handlersToUnregister.forEach(t=>t()),this.handlersToUnregister=[]}_beforeMount(){if(!this.name)throw new Error("You must define a name of plugin when creating a class.")}_afterUnmount(){}_checkRequirements(){return"object"!=typeof this.requires||Object.entries(this.requires).forEach(([t,n])=>{if(!function(t,n,r){const o=function(t,e){var n;if("swup"===t)return null!=(n=e.version)?n:"";{var r;const n=e.findPlugin(t);return null!=(r=null==n?void 0:n.version)?r:""}}(t,r);return!!o&&((t,n)=>n.every(n=>{const[,r,o]=n.match(/^([\D]+)?(.*)$/)||[];var s,i;return((t,e)=>{const n={"":t=>0===t,">":t=>t>0,">=":t=>t>=0,"<":t=>t<0,"<=":t=>t<=0};return(n[e]||n[""])(t)})((i=o,s=e(s=t),i=e(i),s.localeCompare(i,void 0,{numeric:!0})),r||">=")}))(o,n)}(t,n=Array.isArray(n)?n:[n],this.swup)){const e=`${t} ${n.join(", ")}`;throw new Error(`Plugin version mismatch: ${this.name} requires ${e}`)}}),!0}on(t,e,n={}){var r;e=!(r=e).name.startsWith("bound ")||r.hasOwnProperty("prototype")?e.bind(this):e;const o=this.swup.hooks.on(t,e,n);return this.handlersToUnregister.push(o),o}once(e,n,r={}){return this.on(e,n,t({},r,{once:!0}))}before(e,n,r={}){return this.on(e,n,t({},r,{before:!0}))}replace(e,n,r={}){return this.on(e,n,t({},r,{replace:!0}))}off(t,e){return this.swup.hooks.off(t,e)}}return class extends n{constructor(t){void 0===t&&(t={}),super(),this.name="SwupScriptsPlugin",this.requires={swup:">=4"},this.defaults={head:!0,body:!0,optin:!1},this.options=void 0,this.options={...this.defaults,...t}}mount(){this.on("content:replace",this.runScripts)}runScripts(){const{head:t,body:e,optin:n}=this.options,r=this.getScope({head:t,body:e});if(!r)return;const o=Array.from(r.querySelectorAll(n?"script[data-swup-reload-script]":"script:not([data-swup-ignore-script])"));o.forEach(t=>this.runScript(t)),this.swup.log(`Executed ${o.length} scripts.`)}runScript(t){const e=document.createElement("script");for(const{name:n,value:r}of t.attributes)e.setAttribute(n,r);return e.textContent=t.textContent,t.replaceWith(e),e}getScope(t){let{head:e,body:n}=t;return e&&n?document:e?document.head:n?document.body:null}}});
|
|
2
|
+
//# sourceMappingURL=index.umd.js.map
|