feat: 更新頁腳配置,增加導航欄和版權信息,改進樣式和結構

fix: 修改 getBgPath 函數以使用 this.url_for 獲取圖片的正確路徑
feat: 增加右側配置按鈕的動畫效果
This commit is contained in:
Jerry
2025-03-23 23:20:12 +08:00
parent a3f6b625ed
commit ca030589fb
10 changed files with 136 additions and 60 deletions

View File

@@ -81,7 +81,7 @@ hexo.extend.helper.register('findArchivesTitle', function (page, menu, date) {
return loop(menu) || defaultTitle
})
hexo.extend.helper.register('getBgPath', path => {
hexo.extend.helper.register('getBgPath', function(path) {
if (!path) return ''
const absoluteUrlPattern = /^(?:[a-z][a-z\d+.-]*:)?\/\//i
@@ -91,7 +91,7 @@ hexo.extend.helper.register('getBgPath', path => {
if (colorPattern.test(path)) {
return `background-color: ${path};`
} else if (absoluteUrlPattern.test(path) || relativeUrlPattern.test(path)) {
return `background-image: url(${path});`
return `background-image: url(${this.url_for(path)});`
} else {
return `background: ${path};`
}