Compare commits

...

3 Commits

Author SHA1 Message Date
Nofated095 0acb102bd2 bump to 32 2023-11-24 23:19:54 +08:00
Nofated095 5cf2fee8d2 fix sw.js reg 2023-11-24 23:15:43 +08:00
Nofated095 de658f1ddd update sw.js 2023-11-24 22:55:20 +08:00
4 changed files with 14 additions and 5 deletions

View File

@ -1,6 +1,6 @@
name: Node.js Package
on: workflow_dispatch
on: push
jobs:
publish:

View File

@ -164,7 +164,6 @@ module.exports = class extends Component {
<link rel="preconnect" href="https://xgjalbum.oss-cn-hangzhou.aliyuncs.com" />
<link rel="preconnect" href="https://cdn.staticfile.org" />
<link rel="preconnect" href="https://fonts.sourcegcdn.com" />
{canonical_url ? <link rel="canonical" href={canonical_url} /> : null}
{rss ? <link rel="alternate" href={url_for(rss)} title={config.title} type="application/atom+xml" /> : null}
{favicon ? <link rel="icon" href={url_for(favicon)} /> : null}
@ -172,6 +171,17 @@ module.exports = class extends Component {
{hlTheme ? <link rel="preload" as="style" onload="this.onload=null;this.rel='stylesheet'" href={cdn('highlight.js', '11.7.0', 'styles/' + hlTheme + '.css')} /> : null}
<link rel="preload" as="style" onload="this.onload=null;this.rel='stylesheet'" href={fontCssUrl[variant]} />
<link rel="stylesheet" href={url_for('/css/' + variant + '.css')} />
<script>
if ('serviceWorker' in navigator) {
window.addEventListener('load', function () {
navigator.serviceWorker.register('/js/sw.js').then(function (registration) {
console.log('ServiceWorker registration successful with scope: ', registration.scope);
}).catch(function (err) {
console.log('ServiceWorker registration failed: ', err);
});
})
}
</script>
<Plugins site={site} config={config} helper={helper} page={page} head={true} />
{adsenseClientId ? <script data-ad-client={adsenseClientId}

View File

@ -43,9 +43,8 @@ module.exports = class extends Component {
<script src={url_for('/js/sw.js')} defer={true}></script>
<script>
var lazyLoadInstance = new LazyLoad({
});
});
</script>
</Fragment>;
}
};

View File

@ -1,6 +1,6 @@
{
"name": "hexo-theme-amane",
"version": "0.0.29",
"version": "0.0.32",
"author": "Nofated095 <nofated095@users.noreply.github.com>",
"license": "MIT",
"description": "A simple, delicate, and modern theme for Hexo",