hexo-theme-huxblog
hexo-theme-huxblog copied to clipboard
背景图片怎么设置?
你好,用了你的主题后,背景图片是空的,请问怎么设置?
@xingchenfengn 如果是post的話可以在你的文章中新增header-img:"path/to/picture"
for example:
---
title: {{ title }}
subtitle: <subtitle>
date: {{ date }}
header-img: "path/to/picture"
tags:
---
设置了不起作用啊
我的也不能显示,测试了一下,hexo g生成的静态html文件中是能够正常解析header-img的,但是在本地环境不能解析
这是hexo 的问题吗
@paulyung541 @xchz 你們好
我想原本版主的意思應該是希望每篇文章有自己的背景圖,所以大家再新增post時會同步產生一個同名稱的文件夾,這時把想要的背景圖放到這個資料夾並且修改md檔的header-img
就可以看到圖片了!
為了方便理解我這邊舉個例子:
- 當你使用指令
hexo new post cool
這時 hexo 會同時創建cool.md
以及cool/
這個檔案及同名稱的資料夾。 - 這時將你想要的背景圖("cool-header.png")放到
cool/
裡面。 - 這時修改
cool.md
:
---
title: {{ title }}
subtitle: <subtitle>
date: {{ date }}
header-img: "cool-header.png"
tags:
---
<!--你的內容-->
就會有header的圖片拉~
BTW打個小廣告,歡迎來我的網站看看 😄 BeanTech 謝謝指教