liuyib / hexo-theme-stun

🦄 An elegant theme for Hexo
https://theme-stun.github.io/docs/
MIT License
625 stars 126 forks source link

主页顶部背景图片无法显示 #271

Closed polo-0831 closed 2 years ago

polo-0831 commented 2 years ago

我想创建一个新的 issue

环境信息

Stun 版本: v2.6.2

Hexo 版本: v5.4.0

平台信息: windows 10

浏览器信息: Microsoft edge

Node.js 和 NPM 版本: v16.14.2 8.5.0

NPM 依赖信息: hexo-site@0.0.0 D:\Blog ├── hexo-asset-image@1.0.0 ├── hexo-deployer-git@3.0.0 -> .\node_modules_hexo-deployer-git@3.0.0@hexo-deployer-git ├── hexo-generator-archive@1.0.0 ├── hexo-generator-category@1.0.0 ├── hexo-generator-index@2.0.0 ├── hexo-generator-tag@1.0.0 ├── hexo-renderer-ejs@2.0.0 ├── hexo-renderer-marked@4.1.0 ├── hexo-renderer-pug@2.0.0 ├── hexo-renderer-stylus@2.0.1 ├── hexo-server@2.0.0 ├── hexo-theme-landscape@0.0.3 └── hexo@5.4.0

Hexo 配置信息:

查看代码 ... ```yml ```

Stun 配置信息:

查看代码 ... ```yml # --------------------------------------------------------------- # Theme Core Configuration Settings # --------------------------------------------------------------- # Remove unnecessary files after hexo generate. shake_file: true # --------------------------------------------------------------- # SEO Settings # --------------------------------------------------------------- # If true, will add site-subtitle to index page. # Remember to set up your site-subtitle in Hexo `_config.yml`. index_subtitle: false # Set a canonical link tag for your Hexo site. # See: https://support.google.com/webmasters/answer/139066 # Remember to set up your URL in Hexo `_config.yml` (e.g. url: http://yoursite.com) canonical: true # Webmaster tools verification setting # --------------------------------------------------------------- # Google Webmaster tools verification setting # See: https://www.google.com/webmasters/ google_site_verification: # Bing Webmaster tools verification setting # See: https://www.bing.com/webmaster/ bing_site_verification: # Baidu Webmaster tools verification setting # See: https://ziyuan.baidu.com/site/ baidu_site_verification: # 360 Webmaster tools verification setting # see http://zhanzhang.so.com/ qihu360_site_verification: # Sougou Webmaster tools verification setting # see http://zhanzhang.sogou.com/ sougou_site_verification: # --------------------------------------------------------------- # Menu config # --------------------------------------------------------------- # The menu in the website header. # Value before `||` is the target link, value after `||` is the name of FontAwesome icon. # Usage(With Icon): `Key: /link/ || fa(s|r|l|d|b) fa-iconname` # Usage(No Icon) : `Key: /link/` # Select your icon name, see: https://fontawesome.com/icons menu: home: / || fas fa-home archives: /archives/ || fas fa-folder-open categories: /categories/ || fas fa-layer-group tags: /tags/ || fas fa-tags # You can add a secondary menu like follow. # xxx1: javascript:; || fa(s|r|l|d|b) fa-xxx # Secondary menu submenu: # Add item of secondary menu in here. # xxx1: # xxx1-1: /xxx1-1/ || fa(s|r|l|d|b) fa-xxx # xxx1-2: /xxx1-2/ || fa(s|r|l|d|b) fa-xxx menu_settings: # Only show by icon. icon_only: false # Only show by text. text_only: false # --------------------------------------------------------------- # Site config # --------------------------------------------------------------- favicon: small: /images/icons/favicon_polo-16x16.png medium: /images/icons/favicon_polo-32x32.png # ! -------------------------------------------------- # ! If you don't know the following, please ignore it. # ! -------------------------------------------------- # apple_touch_icon: /images/icons/apple-touch-icon.png # safari_pinned_tab: /images/icons/stun-logo.svg # msapplication: /images/icons/favicon-144x144.png # 表示在 Windows 8/10 的开始菜单中,磁贴的背景颜色 apple_touch_icon: /images/icons/apple-touch-icon-180x180_polo.png # 180x180 像素大小的图片 safari_pinned_tab: image: /images/icons/safari-pinned-tab_polo.svg # SVG 格式的图片 # 表示在 Mac OS 上的 Safari 浏览器中,固定的标签页被选中时,图标的颜色 # 表示在 MacBook 上的 Touch Bar 中,图标的背景颜色 color: "#f660e3" # Progressive Web Apps # See: https://github.com/lavas-project/hexo-pwa/ pwa: enable: false manifest: /manifest.json # (Please use "" to wrap the value) theme_color: "#54bcff" # Night mode night_mode: enable: true # The button of switching to the night mode. button: # Color of button (Please use "" to wrap the value). color: "#fafafa" # Background color of button (Please use "" to wrap the value). bg_color: "#8c8a8a" # The icon that stand for day and night. icon: dark: 🌜 light: 🌞 # The layout for sidebar and content of site. layout: # The width of the content area in website. content: 768px # The width of the sidebar in website. sidebar: 300px # The width between the content and the sidebar. content_sidebar_gap: 30px # The padding property of the main tag. # e.g. Usage: # 20px # 20px 30px # 20px 20px 30px # 20px 30px 40px 25px main_padding: # Take effect when screen width in: [768px, Infinity) default: 20px # Take effect when screen width in: [576px, 768px) tablet: 15px # Take effect when screen width in: [0px, 576px) mobile: 10px # The header of site. header: enable: true show_on: post: true height: 80% bg_image: enable: true url: /images/icons/first_photo_in_NJUPT.jpg mask: enable: true opacity: 0.65 nav: height: 50px bg_color: "#333" scroll_down_icon: enable: true # https://fontawesome.com/icons name: fas fa-angle-down animation: true # The body of site. body: # Background image of site body. bg_image: enable: false # In theme directory (source/images): /images/avatar.png # In site directory (source/uploads): /uploads/avatar.png # You can also use a link of image. url: # Whether to fixed the background image. fixed: true # Whether to repeat the image as much as possible to cover the entire area. repeat: false # Mask effect of the background image. mask: enable: false # Opacity of mask (value: 0 ~ 1) opacity: # Opacity of the mask by default. default: 0.4 # Opacity of the mask in night mode. night_mode: 0.6 # The footer of site. footer: # Background image of site footer. bg_image: enable: false # In theme directory (source/images): /images/avatar.png # In site directory (source/uploads): /uploads/avatar.png # You can also use a link of image. url: # Mask effect of the background image. mask: enable: false # Opacity of mask (value: 0 ~ 1) opacity: 0.5 # Copyright information. copyright: enable: true # If not set, will be used `author` from Hexo main config (e.g. liuyib All Rights Reserved) text: # Start time. If not set, the current year will be used. since: # End time. If not set, the current year will be used. end: # The icon between the copyright and the owner. icon: enable: true # Icon name in FontAwesome, see: https://fontawesome.com/icons name: fas fa-heart # Heartbeat animation. animation: false # (Please use "" to wrap the value) color: "#ff0000" # Hexo link powered: enable: true # Whether to show version after Hexo link (e.g. vX.X.X) version: true # Theme link theme: enable: true # Whether to show version after theme link (e.g. vX.X.X) version: true # Beian information for Chinese users, see: http://www.miitbeian.gov.cn/ beian: enable: false # 备案 XXXXXXXX 号 icp: # Any custom text (e.g. Hosted by Github Pages) custom: enable: false text: # Creative Commons 4.0 International License creative_commons: enable: true # Optional values: BY | BY-SA | BY-ND | BY-NC | BY-NC-SA | BY-NC-ND # For details, please see: https://creativecommons.org/share-your-work/licensing-types-examples/ license: BY-NC-SA # Show the CC license in the sidebar. sidebar: true # Show the CC license at the post bottom. post: true # Optional values: # id | ms | ca | da | de | en | es | es_ES | eo | eu | fr | gl | hr # it | lv | lt | hu | nl | no | pt | pt_BR | pl | ro | sl | fi | sv # tr | is | cs | el | be | ru | zh | zh_TW | uk | ar | fa | bn | ja | ko # If not set, `en` will be used by default. language: # Back to top back2top: enable: true icon: # Icon name in FontAwesome, see: https://fontawesome.com/icons name: fas fa-rocket # Rotation Angle of icon. rotate: -45deg # (Please use "" to wrap the value) color: "#49b1f5" # Color when the mouse hovers it (Please use "" to wrap the value) hover_color: "#fc6423" # --------------------------------------------------------------- # Sidebar config # --------------------------------------------------------------- # The sidebar of site. sidebar: enable: true # Optional values: left | right position: right # The distance from the top of the page when the sidebar is fixed (Only `px` unit is supported) offsetTop: 20px # Whether to show horizon line. horizon_line: false author: enable: true # 侧边栏头像 avatar: # 填写图片路径或链接 url: /images/icons/safari-pinned-tab_polo.svg # 是否显示为圆形 rounded: true # 头像透明度(取值:0 ~ 1) opacity: 1 # 鼠标经过时的动画,可选值:turn 或 shake animation: shake # 格言(可以是任意一句想写的话) motto: 猛兽总是独行,牛羊才成群结队 # Social links # Value before `||` is the target link, value after `||` is the name of FontAwesome icon. # Usage: `Key: /link/ || fa(s|r|l|d|b) fa-iconname` # Select your icon name, see: https://fontawesome.com/icons # If you can`t find a suitable icon, you can choose to display text by adding the `origin:` prefix. # e.g. `origin:sf`, so `sf` will be displayed. social: github: https://github.com/polo-0831/ || fab fa-github # google: https://plus.google.com/ || fab fa-google # twitter: https://twitter.com/ || fab fa-twitter # youtube: https://youtube.com/ || fab fa-youtube # segmentfault: https://segmentfault.com/ || origin:sf # weibo: https://weibo.com/ || fab fa-weibo # zhihu: https://www.zhihu.com/ || origin:知 # wechat: Suck_Ken || fab fa-weixin bilibili: https://space.bilibili.com/151399898?spm_id_from=333.1007.0.0 || fab fa-youtube # telegram: yournumber || fab fa-telegram # qq: 172312551 || fab fa-qq social_setting: enable: true # Only show by icon. icon_only: true # Table Of Contents in the Sidebar. toc: enable: true # Automatically add list number to toc. list_number: true # If true, all words will be placed on the next lines when they overflow. wrap: true # If true, the toc of post will always be displayed, rather than the activated part of it. expand_all: false # Minimum heading depth of generated toc. # You can also set it in Front-matter by `toc_max_depth`. min_depth: 1 # You can also set it in Front-matter by `toc_min_depth`. # Maximum heading depth of generated toc. max_depth: 6 # Subscribe of email and rss. feed: enable: false # Enter your email subscription link (e.g. http://eepurl.com/guAE6j) email: # Enter the rss address of you set (e.g. /atom.xml) # Dependency: https://github.com/hexojs/hexo-generator-feed/ # !!! Don't enable this before install dependency by `npm install hexo-generator-feed --save` in hexo root directory. rss: # The reading progress of post. reading_progress: enable: true # (Please use "" to wrap the value) color: "#fc6423" height: 1px # --------------------------------------------------------------- # Page config # --------------------------------------------------------------- codeblock: # The style of code block. # Optional values: default | simple | carbon style: default # The theme of code highlight. # Optional values: light | dark | ocean highlight: light # Whether to wrap when code overflow. word_wrap: false # Add a line below h1, h2 tags. heading_line: true # Reward QR Code reward: enable: false # Your QR code for collecting money. alipay: wechat: # --------------------------------------------------------------- # Post config # --------------------------------------------------------------- # The information of post. post_meta: # Only show by icon. icon_only: false # The create time of post. created: enable: true # Icon name in FontAwesome, see: https://fontawesome.com/icons icon: far fa-calendar-plus # The update time of post. updated: enable: true # Icon name in FontAwesome, see: https://fontawesome.com/icons icon: far fa-calendar-check # The approximate reading time of post. # Dependency: https://github.com/willin/hexo-wordcount/ # !!! Don't enable this before install dependency by `npm install hexo-wordcount --save` in hexo root directory. reading_time: enable: false # Icon name in FontAwesome, see: https://fontawesome.com/icons icon: far fa-clock # Set reading speed to count reading time. speed: # Reading speed of zh-CN. zh: 200 # Reading speed of en-US. en: 80 # Counting the words of post. # Dependency: https://github.com/willin/hexo-wordcount/ # !!! Don't enable this before install dependency by `npm install hexo-wordcount --save` in hexo root directory. word_count: enable: false # Icon name in FontAwesome, see: https://fontawesome.com/icons icon: far fa-file-word # The article list on the homepage or archives page. post_list: # Whether to paginate. paginate: home: true archives: false # Whether to show the cover image of post. cover_image: home: false # The widget of post. post_widget: # Whether to show tags at the bottom of post. tags: true # Whether to show "------ END ------" at the bottom of post. end_text: enable: true # Whether to show a horizon line before "------ END ------". horizon_line: true # Article sharing share: enable: false # The text displayed before the share button. label: "Share to: " # Optional values: qzone | qq | weibo | wechat | douban | linkedin | facebook | twitter | google target: qzone, qq, weibo, wechat, douban, linkedin, facebook, twitter, google # Stick post to the top # Dependency: https://github.com/netcan/hexo-generator-index-pin-top/ # !!! Don't enable this before install dependency by `npm install hexo-generator-index-pin-top --save` in hexo directory. stick_top: # Position of icon # Optional values: left | right position: right # Icon name in FontAwesome, see: https://fontawesome.com/icons icon: fas fa-thumbtack # Rotation Angle of icon. rotate: 45deg # (Please use "" to wrap the value) color: "#999" # --------------------------------------------------------------- # Comment config # --------------------------------------------------------------- # Gittalk # See: https://github.com/gitalk/gitalk/ gitalk: enable: false # Github username. owner: # Github repository. repo: # Github Application Client ID. client_id: # Github Application Client Secret. client_secret: # GitHub repo owner and collaborators, only these guys can initialize github issues. admin: # Facebook-like distraction free mode. distraction_free_mode: false # Gitalk's display language depends on user's browser or system environment. # If you want everyone visiting your site to see a uniform language, you can set a force language value. # Optional values: en | zh-CN | es-ES | fr | ru | zh-TW language: # Waline # See: https://waline.js.org/ waline: enable: false # The URL of your server. serverURL: # Comment box placeholder. placeholder: Just go go # Gravatar style. avatar: mp # Custom comment header. meta: nick,mail,link # The number of comments per page. pageSize: 10 # Optional values: en | zh-CN | zh-TW | jp lang: zh-CN,zh-TW,en # Article reading statistics. visitor: false # Valine # See: https://valine.js.org/quickstart.html valine: enable: false # Your leancloud application appid. appid: # Your leancloud application appkey. appkey: # Mail notifier. notify: true # Verification code. verify: true # Comment box placeholder. placeholder: Just go go # Gravatar style. avatar: mp # Custom comment header. meta: nick,mail,link # Pagination size. pageSize: 10 # Article reading statistics. visitor: false # Whether to record the commenter IP. recordIP: false # Optional values: en | zh-cn language: # MiniValine # See: https://github.com/MiniValine/MiniValine#Options minivaline: enable: false appId: # Your leancloud application appid appKey: # Your leancloud application appkey placeholder: Write a Comment # Comment box placeholder adminEmailMd5: # The MD5 of Admin Email to show Admin Flag. math: true # Support MathJax. md: true # Support Markdown. # MiniValine's display language depends on user's browser or system environment # If you want everyone visiting your site to see a uniform language, you can set a force language value # Optional values: en | zh-CN | (and many more) # More i18n info: https://github.com/MiniValine/minivaline-i18n lang: # Livere # See: https://www.livere.com/ livere: enable: false uid: # Disqus # See: https://disqus.com/ disqus: enable: false shortname: count: true # Utterances # See: https://utteranc.es/ utterances: enable: false # Github username. owner: # Github repository. repo: # Choose the mapping between blog posts and GitHub issues. # Optional values: pathname | url | title | og:title mapping: title # Choose the label that will be assigned to issues created by Utterances. # Emoji are supported in label names. label: utterances # Choose an Utterances theme that matches your blog. # Optional values: github-light | github-dark | github-dark-orange | icy-dark | dark-blue | photon-dark theme: github-light # ! ------------------------------------------------------------------------------- # ! Don't set this unless the URL of the script in the official website is changed. # ! ------------------------------------------------------------------------------- script_url: https://utteranc.es/client.js # Facebook Comments # See: https://developers.facebook.com/docs/plugins/comments fbcomments: enable: false # The ID of your own Facebook App. appId: # See: https://developers.facebook.com/docs/internationalization#locales # Example: en_US | zh_CN | zh_HK ... and so on. For detail, see: ☝ lang: en_US # Number of comments displayed by default. numPosts: 10 # See: https://developers.facebook.com/docs/plugins/comments#sorting # Optional values: social | reverse_time | time order_by: reverse_time # Optional values: true | false lazy: true # Whether to optimize the display on the mobile. # Optional values: true | false mobile: true width: 100% # --------------------------------------------------------------- # Statistics and Analytics config # --------------------------------------------------------------- # Busuanzi statistics # See: https://busuanzi.ibruce.info/ busuanzi: enable: true # Only show by icon. icon_only: false # Number of unique visitor to the entire site. site_uv: enable: true # Icon name in FontAwesome, see: https://fontawesome.com/icons icon: fas fa-user # Number of page view to the entire site. site_pv: enable: true icon: fas fa-eye # Number of page view to a post. post_pv: enable: true icon: fas fa-eye # Google analytics ID # See: https://analytics.google.com/ google_analytics: # Baidu analytics ID # See: https://tongji.baidu.com/ baidu_analytics: # Tencent analytics ID # See: https://v2.ta.qq.com/ tencent_analytics: # --------------------------------------------------------------- # Search config # --------------------------------------------------------------- # Algolia Search # Dependency: https://github.com/algolia/instantsearch.js/ algolia_search: enable: false hits: # Number of search results displayed per page. per_page: 10 labels: # Whether to show stats of search. show_stats: true # Local Search # See: https://github.com/wzpan/hexo-generator-search/ local_search: enable: false # Auxiliary search buttons # ! ----------------------------------------------------------------------------------------- # ! This feature can only be enabled if either `algolia_search` or `local_search` is enabled. # ! ----------------------------------------------------------------------------------------- assist_search: enable: false # Show the Google Search button. Use `www.google.com` to search for what you type. google: true # Show the Bing Search button. Use `www.bing.com` to search for what you type. bing: true # Show the Baidu Search button. Use `www.baidu.com` to search for what you type. baidu: true # --------------------------------------------------------------- # Background config # --------------------------------------------------------------- # Canvas-ribbon # Dependency: https://github.com/hustcc/ribbon.js canvas_ribbon: enable: false # The width of the ribbon. size: 120 # The transparency of the ribbon. alpha: 0.6 # The display level of the ribbon. zIndex: -1 # Canvas-nest # Dependency: https://github.com/hustcc/canvas-nest.js canvas_nest: enable: false # Color of lines. # RGB values, use `,` to separate. color: "0,0,0" # The opacity of lines (value: 0 ~ 1) opacity: 0.6 # The number of lines. count: 99 # `z-index` property of the background. zIndex: -1 # --------------------------------------------------------------- # Math and Chart config # --------------------------------------------------------------- math: enable: false # If true, this function will be enabled on every page. # If false, this function will be enabled only if the page where `math: true` is set in `Front-matter`. per_page: false # ! ------------------------------------------------------------------------------- # ! Please see the documentation before using. See: # ! https://theme-stun.github.io/docs/zh-CN/advanced/third-part.html#mathjax # ! ------------------------------------------------------------------------------- # Optional values: mathjax | katex engine: katex mathjax: cdn: https://cdn.jsdelivr.net/npm/mathjax/MathJax.js?config=TeX-AMS-MML_HTMLorMML # See: https://mhchem.github.io/MathJax-mhchem/ mhchem: enable: false mhchem_js: https://cdn.jsdelivr.net/npm/mathjax-mhchem@3.3.2/mhchem.min.js katex: cdn: https://cdn.jsdelivr.net/npm/katex@0.10.2/dist/katex.min.css # See: https://github.com/KaTeX/KaTeX/tree/master/contrib/copy-tex copy_tex: enable: true copy_tex_js: https://cdn.jsdelivr.net/npm/katex@0.10.2/dist/contrib/copy-tex.min.js copy_tex_css: https://cdn.jsdelivr.net/npm/katex@0.10.2/dist/contrib/copy-tex.css # --------------------------------------------------------------- # Other config # --------------------------------------------------------------- # Fancybox # See: https://fancyapps.com/fancybox/3/ fancybox: false # Click to enlarge picture. zoom_image: enable: true # The color of mask. # (Please use "" to wrap the value) mask_color: "rgba(0,0,0,0.6)" # The gap between image and a edge of screen when image is enlarged. # (Only `px` unit is supported) gap_aside: 20px # If you are use "photos" attribute in the Front-matter, # you can enable this to show images in waterfalls flow. # See: https://github.com/desandro/masonry/ gallery_waterfall: enable: false col_width: 220px gap_x: 10px gap_y: 10px # Lazy load the images of post. # See: https://github.com/tuupola/lazyload lazyload: enable: false # Optional values: gif | block placeholder: gif # Quicklink support # See: https://github.com/GoogleChromeLabs/quicklink/ quicklink: enable: false # Quicklink (quicklink.umd.js script) is loaded on demand. # Add `quicklink: true` in Front-matter of the page or post you need. # Home page and archive page can be controlled through home and archive options below. home: true archive: true # Initialize quicklink after the load event fires. delay: true # Custom a time in milliseconds by which the browser must execute prefetching. timeout: 10000 # Enable fetch() or falls back to XHR. priority: true # For more flexibility you can add some patterns (RegExp, Function, or Array) to ignores. # See: https://github.com/GoogleChromeLabs/quicklink#custom-ignore-patterns # ! -------------------------------------------------- # ! If you don't know the following, please ignore it. # ! -------------------------------------------------- ignores: - /\/api\/?/ - uri => uri.includes('.xml') - uri => uri.includes('.zip') - (uri, el) => el.hasAttribute('nofollow') - (uri, el) => el.hasAttribute('noprefetch') # Pjax # See: https://github.com/MoOx/pjax/ pjax: enable: false # When switching pages, scroll to the bottom of the top image. avoid_banner: false # ! -------------------------------------------------- # ! If you don't know the following, please ignore it. # ! -------------------------------------------------- # Please see: https://github.com/MoOx/pjax/#options elements: selectors: switches: switchesOptions: history: true # If you enable this, you must set `avoid_banner: false` firstly. scrollTo: false scrollRestoration: false cacheBust: false debug: false currentUrlFullReload: false timeout: 0 # Google AdSense google_adsense: enable: false client: js_src: https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js # The links with `target="_blank"` attribute. external_link: # Adding an icon make it easier for users to know that this is an external link. icon: enable: true # Icon name in FontAwesome, see: https://fontawesome.com/icons name: fas fa-external-link-alt # (Please use "" to wrap the value) color: "#aaa" # The shortcuts of the site. shortcuts: # Switch to the prev / next post by key. # `Ctrl + ←` is the shortcuts to prev post. # `Ctrl + →` is the shortcuts to next post. switch_post: enable: false # Tag cloud # If not used, comment it or ignore it. tag_cloud: # (Please use "" to wrap the value) start_color: "#a4d8fa" end_color: "#49b1f5" # Size for tag. min_size: 16 max_size: 26 # Maximum number of tags displayed. Change it if you have more than 200 tags. max_amount: 200 # Eliminate the old version of IE browser (IE6~11). # See: https://support.dmeng.net/upgrade-your-browser.html kill_old_ie: enable: false # The URL of warning page (Please use "" to wrap the value). # ! ---------------------------------------------------------------- # ! Usually you don't need to set this option, just use the default. # ! ---------------------------------------------------------------- warning_url: https://support.dmeng.net/upgrade-your-browser.html # Assets # In theme directory (source/css) css: css # In theme directory (source/js) js: js # In theme directory (source/images) images: images # Set icon for some components. # Icon name in FontAwesome, see: https://fontawesome.com/icons # ! ------------------------------------------------------------------- # ! Do not edit the follow configs, unless you know what you are doing. # ! ------------------------------------------------------------------- icon: search: fas fa-search localsearch_empty: far fa-meh menu_btn: fas fa-bars feed_email: fas fa-envelope feed_rss: fas fa-rss paginator_prev: fas fa-angle-left paginator_next: fas fa-angle-right read_more_btn: fas fa-long-arrow-alt-right post_tags: fas fa-tag copy_btn: fas fa-copy prompt_success: fas fa-check-circle prompt_info: fas fa-arrow-circle-right prompt_warning: fas fa-exclamation-circle prompt_error: fas fa-times-circle waline_visitor: fas fa-eye valine_visitor: fas fa-eye post_heading: fas fa-link notetag_default: fas fa-arrow-circle-right notetag_success: fas fa-check-circle notetag_info: fas fa-info-circle notetag_warning: fas fa-exclamation-circle notetag_danger: fas fa-minus-circle google: fab fa-google # bing: fab fa-bing # not exist # Set a CDN address for the vendor you want to customize. # ! ------------------------------------------------------------------- # ! Do not edit the follow configs, unless you know what you are doing. # ! ------------------------------------------------------------------- cdn: # Using version: 5.12.1 # See: https://fontawesome.com/ # Example: # fontawesome: //cdn.jsdelivr.net/npm/font-awesome@4.7.0/css/font-awesome.min.css # fontawesome: //cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@5.12.1/css/all.min.css # fontawesome: //cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css # fontawesome: //cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css fontawesome: # Using version: 3.4.1 # Example: # jquery: //cdn.jsdelivr.net/npm/jquery@v3.4.1/dist/jquery.min.js # jquery: //cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js jquery: # Using version: 1.5.2 # See: http://velocityjs.org/ # Example: # velocity: //cdn.jsdelivr.net/npm/velocity-animate@1.5.2/velocity.min.js # velocity: //cdnjs.cloudflare.com/ajax/libs/velocity/1.5.2/velocity.min.js # velocity_ui: //cdn.jsdelivr.net/npm/velocity-animate@1.5.2/velocity.ui.min.js # velocity_ui: //cdnjs.cloudflare.com/ajax/libs/velocity/1.5.2/velocity.ui.min.js velocity: velocity_ui: # gitalk & js-md5 # Using version: latest & latest # See: https://github.com/gitalk/gitalk/, https://github.com/emn178/js-md5/ # Example: # gitalk_js: //cdn.jsdelivr.net/npm/gitalk@latest/dist/gitalk.min.js # gitalk_css: //cdn.jsdelivr.net/npm/gitalk@latest/dist/gitalk.css # md5: //cdn.jsdelivr.net/npm/js-md5@latest/src/md5.min.js gitalk_js: gitalk_css: gitalk_md5: # valine & leancloud-storage # Using version: latest & latest # See: https://github.com/xCss/Valine/, https://www.npmjs.com/package/leancloud-storage/ # Example: # valine: //cdn.jsdelivr.net/npm/valine@latest/dist/Valine.min.js # leancloud_storage: //cdn.jsdelivr.net/npm/leancloud-storage@latest/dist/av-min.js valine: leancloud_storage: # Waline # See: https://github.com/lizheming/waline # Example: # waline: //unpkg.com/@waline/client@0.8.5/dist/Waline.min.js waline: # minivaline # See: https://github.com/MiniValine/MiniValine # Example: # minivaline: //cdn.jsdelivr.net/npm/minivaline/dist/MiniValine.min.js minivaline: # busuanzi # Using version: latest # See: https://busuanzi.ibruce.info/ # Example: # busuanzi: //cdn.jsdelivr.net/gh/sukkaw/busuanzi@latest/bsz.pure.mini.js busuanzi: # Using version: 2.1.1 # See: https://busuanzi.ibruce.info/ # Example: # instantsearch_js: //cdn.jsdelivr.net/npm/instantsearch.js@2.1.1/dist/instantsearch.min.js # instantsearch_css: //cdn.jsdelivr.net/npm/instantsearch.js@2.1.1/dist/instantsearch.min.css instantsearch_js: instantsearch_css: # Using version: latest # See: https://github.com/hustcc/ribbon.js # Example: # canvas_ribbon: //cdn.jsdelivr.net/npm/ribbon.js@latest/dist/ribbon.min.js canvas_ribbon: # Using version: latest # See: https://github.com/hustcc/canvas-nest.js # Example: # canvas_nest: //cdn.jsdelivr.net/npm/canvas-nest.js@1.0.1/dist/canvas-nest.min.js canvas_nest: # Using version: 3.5.7 # See: https://www.fancyapps.com/fancybox/3/ # Example: # fancybox_js: //cdn.jsdelivr.net/gh/fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.js # fancybox_css: //cdn.jsdelivr.net/gh/fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.css fancybox_js: fancybox_css: # Using version: 4.2.2 # See: https://masonry.desandro.com/ # Example: # masonry: //cdn.jsdelivr.net/npm/masonry-layout@4.2.2/dist/masonry.pkgd.min.js masonry: # Using version: 2.0.0-rc.2 # See: https://github.com/tuupola/lazyload/ # Example: # lazyload: //cdn.jsdelivr.net/npm/lazyload@2.0.0-rc.2/lazyload.min.js lazyload: # Using version: latest # See: https://github.com/GoogleChromeLabs/quicklink/ # Example: # quicklink: //cdn.jsdelivr.net/npm/quicklink@latest/dist/quicklink.umd.js quicklink: # Using version: latest # See: https://github.com/MoOx/pjax/ # Example: # pjax: //cdn.jsdelivr.net/npm/pjax@latest/pjax.min.js pjax: # Using version: 1.0.16 # See: https://github.com/overtrue/share.js # Example: # share_js: //cdn.jsdelivr.net/npm/social-share.js@1.0.16/dist/js/social-share.min.js # share_css: //cdn.jsdelivr.net/npm/social-share.js@1.0.16/dist/css/share.min.css share_js: share_css: ```

预期行为

修改了bg_image中的url地址,hexo g -d后在在线博客网页上显示背景图片

实际行为

在线博客不能显示背景图片 hexo s后可以显示背景图片

重现步骤

  1. 修改配置文件 image 图片文件路径为:D:\Blog\source\images\icons\first_photo_in_NJUPT.jpg image

2.在线博客显示: image F12中没有找到background元素,但github仓库内确认有图片文件 3.本地博客显示:一切正常 image

其他信息


YiHui-Liu commented 2 years ago

修改的配置文件请存放在source/data目录下

YiHui-Liu commented 2 years ago

另外我并没有在你的public目录中找到这个图片文件

polo-0831 commented 2 years ago

修改的配置文件请存放在source/data目录下 image 我将图片放在一个新的文件夹上,并且hexo g -d上了云仓库中: image 这是我的hexo配置文件内的配置,依旧是老样子,本地部署可以显示,在线就不可以了 image 您的意思是把stun主题的的yml文件放在\themes\stun\source下吗?

polo-0831 commented 2 years ago

整个header类貌似都不能正常工作,下滑标志我也添加进去了,但是在线博客也没显示,本地博客是可以的。(鄙人不才没学过前端,不知道这样描述准不准确) image image

YiHui-Liu commented 2 years ago

我说的不是图片文件,图片可以按照原本的放置,但是yml配置文件需要放置到source/_data目录下,并且重命名为stun.yml,这是因为hexo升级后会从该目录下读取配置 可以发现,你的css文件中,.header-banner类并没有background属性,而将配置文件迁移后是有的: image

YiHui-Liu commented 2 years ago

修改的配置文件请存放在source/data目录下

抱歉,这里我写错了,不是source/data,应该是source/_data 所以最终的配置文件应该是source/_data/stun.yml 如果解决了问题,麻烦关闭issue

polo-0831 commented 2 years ago

我说的不是图片文件,图片可以按照原本的放置,但是yml配置文件需要放置到source/_data目录下,并且重命名为stun.yml,这是因为hexo升级后会从该目录下读取配置 可以发现,你的css文件中,.header-banner类并没有background属性,而将配置文件迁移后是有的: image

感谢回答,提供了一个新的解决思路。 博客文件内有两个source文件夹,是放在hexo的source文件夹内还是stun主题的source文件夹内呢?我两个文件夹都将stun配置文件剪切进去并重命名,重新部署仍然未能达到期望效果 image

YiHui-Liu commented 2 years ago

可以参考文档中平滑升级的部分


你不需要重新部署查看效果,只需要执行hexo g命令后,查看public/css/index.css文件中的.header-banner是否有background即可。

另外,如果你更改了配置文件,最好先执行hexo clean后再进行hexo ghexo d,不然有可能文件不会被修改。例如删除背景图片后,直接进行hexo g,可以看到生成文件无变化:

1651999672(1)

polo-0831 commented 2 years ago

问题已经解决,把配置文件移植就可以。 另外学到了vscode的代码比较功能,thx