EvanNotFound / hexo-theme-redefine

Simplicity in Speed, Purity in Design. Redefine Your Hexo Journey.
https://redefine.ohevan.com
GNU General Public License v3.0
1.39k stars 112 forks source link

[BUG] 非首页无法显示背景图片 #317

Closed Huasushis closed 7 months ago

Huasushis commented 9 months ago

提交 Issue 前检查清单

Bug 描述

更新主题后发现非第一页的背景图片没有了。黑夜白天模式都没有,尝试在 linux 内进行复现。

复现方法

由于我没有在家,在 linux 内尝试复现,安装最新版本的 npm,然后安装 hexo 并下载最新版本的主题,保证 _posts 文件夹中至少11个文件后,运行 hexo clean hexo g hexo s 后进入网页发现第二页以后背景图片都没有显示。

预期结果

显示背景图片。

截图

No response

电脑操作系统

Ubuntu 23.10

浏览器

Firefox

版本

2.6.0

移动端设备

No response

移动端操作系统

No response

浏览器

No response

版本

No response

其他

No response

viEcho commented 8 months ago

此问题我已发现,home-banner-backgroud.ejs中代码按如下格式替换即可,当然这里写死了;你也可以按首页变量获取方式,但是自认为这种写法比较高效;且此ejs中代码较少,背景图更换不频繁怎么写无所谓解决问题即可

<!-- <div class="home-banner-background">
</div> -->
<div class="home-banner-background transition-fade fixed top-0 left-0 w-screen h-screen scale-125 sm:scale-110 box-border will-change-transform bg-cover">
    <img src="相对路径--去首页粘贴" class="w-full h-full object-cover dark:hidden">
    <img src="相对路径--去首页粘贴" alt="home-banner-background" class="w-full h-full object-cover hidden dark:block">
</div>
EvanNotFound commented 7 months ago

已在 Redefine v2.6.1 版本修复,请前往 https://github.com/EvanNotFound/hexo-theme-redefine/releases 查看并更新主题