new: Use CDN to accelerate all static resources

This commit is contained in:
2025-01-22 23:07:31 +08:00
parent 635198570a
commit 47affe5edf
13 changed files with 132 additions and 164 deletions

View File

@@ -40,7 +40,7 @@ function setTheme() {
const logo = document.querySelector(".main-logo-img")
if (logo !== null) {
logo.style.setProperty("background-image", `url(../assets/img/logo-${theme}-theme.png)`);
logo.style.setProperty("background-image", `url(http://molly-blog.cdn.yvling.cn/assets/img/logo-${theme}-theme.png)`);
}
}
@@ -57,7 +57,7 @@ function replaceCssFile() {
const links = document.querySelectorAll('link[rel="stylesheet"]');
for (const link of links) {
if (link.href.includes(oldHref)) {
link.href = "../assets/css/lib/" + newHref;
link.href = "http://molly-blog.cdn.yvling.cn/assets/css/lib/" + newHref;
break;
}
}

View File

@@ -131,7 +131,7 @@
var musicConf = options.music, target = selector.$(options.target) || document.querySelector('.meplayer'),
theme = options.theme || _constants.THEME_DEFAULT, hasLrc = !!musicConf.lrc,
coverSrc = musicConf.cover || '../../../assets/img/music.png', loop = musicConf.loop || false,
coverSrc = musicConf.cover || '../../http://molly-blog.cdn.yvling.cn/assets/img/music.png', loop = musicConf.loop || false,
autoplay = options.autoplay,
currentThemeClass = theme === _constants.THEME_DEFAULT ? 'meplayer-container' : 'meplayer-container-mini',
containerClass = currentThemeClass + ' ' + (hasLrc ? 'meplayer-haslrc' : '') + ' meplayer-isloading';