Skip to content

Commit

Permalink
๐Ÿž fix: ๅฏๅ•็‹ฌ่ฆ†็›–ๆ’ไปถ CDN
Browse files Browse the repository at this point in the history
  • Loading branch information
็™ฝไบ‘่‹็‹— committed Jan 5, 2023
1 parent b24c769 commit 2f78869
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions package/hexo-theme-async/scripts/filters/cdn.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ hexo.extend.filter.register('before_generate', () => {
});
} else {
let cdn = cdnSource[type] || type

if (/^http:\/\/|^https:\/\/|^\/\//.test(data)) {
return data
}
if (internal) {
if (cdn === 'local') return data
if (cdn) cdn += `/hexo-theme-async@${pkg.version == '0.0.0' ? 'latest' : pkg.version}/source/`
Expand All @@ -41,8 +43,8 @@ hexo.extend.filter.register('before_generate', () => {
}

themeConfig.assets.plugin = Object.assign(
createCDNLink(assets.plugin, assets.internal_provider, true),
createCDNLink(thirdPartySrc, assets.third_party_provider)
createCDNLink(thirdPartySrc, assets.third_party_provider),
createCDNLink(assets.plugin, assets.internal_provider, true)
)
themeConfig.assets._CND_CREATED_ = true
})

0 comments on commit 2f78869

Please sign in to comment.