jerryc127 / hexo-theme-butterfly

🦋 A Hexo Theme: Butterfly
https://butterfly.js.org
Apache License 2.0
7.1k stars 1.28k forks source link

[Bug]: 背景图片无法显示,设置了背景颜色也依旧无法显示 #1476

Closed Lansel2024 closed 5 months ago

Lansel2024 commented 5 months ago

使用的 Butterfly 版本? | What version of Butterfly are you use?

4.13.0

是否修改过主题文件? || Has the theme files been modified?

是 (Yes)

使用的瀏覽器? || What browse are you using?

Edge

使用的系統? || What operating system are you using?

Windows

依賴插件 | Package dependencies Information

├── hexo-deployer-git@4.0.0
├── hexo-generator-archive@2.0.0
├── hexo-generator-category@2.0.0
├── hexo-generator-index@3.0.0
├── hexo-generator-searchdb@1.4.1
├── hexo-generator-tag@2.0.0
├── hexo-renderer-ejs@2.0.0
├── hexo-renderer-marked@6.3.0
├── hexo-renderer-pug@3.0.0
├── hexo-renderer-stylus@3.0.1
├── hexo-server@3.0.0
├── hexo-theme-landscape@1.0.0
├── hexo-wordcount@6.0.1
└── hexo@7.1.1

問題描述 | Describe the bug

屏幕截图 2024-04-06 013635 这是我的主题下的_config.yml中的截图 我hexo -s之后本地能够背景渲染出正确的颜色 屏幕截图 2024-04-06 013837

但是在远端网页上就不行,背景依旧是一片空白 image

以下是我hexo根目录下的config文件

# Hexo Configuration
## Docs: https://hexo.io/docs/configuration.html
## Source: https://github.com/hexojs/hexo/

# Site
title: Lansel
subtitle: ''
description: ''
keywords:
author: lansel
language: zh-CN
timezone: ''

# URL
## Set your site url here. For example, if you use GitHub Page, set url as 'https://username.github.io/project'
url: http://Lansel2024.github.io/
permalink: :year/:month/:day/:title/
permalink_defaults:
pretty_urls:
  trailing_index: true # Set to false to remove trailing 'index.html' from permalinks
  trailing_html: true # Set to false to remove trailing '.html' from permalinks

# Directory
source_dir: source
public_dir: public
tag_dir: tags
archive_dir: archives
category_dir: categories
code_dir: downloads/code
i18n_dir: :lang
skip_render:

# Writing
new_post_name: :title.md # File name of new posts
default_layout: post
titlecase: false # Transform title into titlecase
external_link:
  enable: true # Open external links in new tab
  field: site # Apply to the whole site
  exclude: ''
filename_case: 0
render_drafts: false
post_asset_folder: false
relative_link: false
future: true
syntax_highlighter: highlight.js
highlight:
  line_number: true
  auto_detect: false
  tab_replace: ''
  wrap: true
  hljs: false
prismjs:
  preprocess: true
  line_number: true
  tab_replace: ''

# Home page setting
# path: Root path for your blogs index page. (default = '')
# per_page: Posts displayed per page. (0 = disable pagination)
# order_by: Posts order. (Order by date descending by default)
index_generator:
  path: ''
  per_page: 10
  order_by: -date

# Category & Tag
default_category: uncategorized
category_map:
tag_map:

# Metadata elements
## https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta
meta_generator: true

# Date / Time format
## Hexo uses Moment.js to parse and display date
## You can customize the date format as defined in
## http://momentjs.com/docs/#/displaying/format/
date_format: YYYY-MM-DD
time_format: HH:mm:ss
## updated_option supports 'mtime', 'date', 'empty'
updated_option: 'mtime'

# Pagination
## Set per_page to 0 to disable pagination
per_page: 10
pagination_dir: page

# Include / Exclude file(s)
## include:/exclude: options only apply to the 'source/' folder
include:
exclude:
ignore:

# Extensions
## Plugins: https://hexo.io/plugins/
## Themes: https://hexo.io/themes/
theme: butterfly

# Deployment
## Docs: https://hexo.io/docs/one-command-deployment
deploy:
  type: git
  repo: https://github.com/Lansel2024/Lansel2024.github.io.git
  branch: main

出現問題網站 | Website

https://lansel2024.github.io/

jerryc127 commented 5 months ago

hexo clean

Lansel2024 commented 5 months ago

hexo clean

err我每次对配置有任何修改之后都是hexo c hexo g hexo d三个命令都输入一遍来deploy的

Lansel2024 commented 5 months ago

hexo clean

另外,我之前尝试用图片作为背景,是这样写的: image

然而出现的状况也是本地localhost那里可以加载出这张图片但是远端不行。更奇怪的一点是,我在远端的网页那里F12之后发现元素里面根本没有这张图片

下面是浏览器F12里面报的错 image

Lansel2024 commented 5 months ago

奥奥我后来在discussion里面找到了解决方案

如果遇到本地和远端不一致的情况那么把public文件夹和.deploy_git文件夹删掉再重新hexo clean hexo g hexo d就可以

vinegarwhite commented 3 months ago

我也遇到这个了 后面发现清理一下浏览器缓存就可以了