hexo-theme-huxblog icon indicating copy to clipboard operation
hexo-theme-huxblog copied to clipboard

背景图片怎么设置?

Open xingchenfengn opened this issue 8 years ago • 5 comments

你好,用了你的主题后,背景图片是空的,请问怎么设置?

xingchenfengn avatar Jan 18 '17 03:01 xingchenfengn

@xingchenfengn 如果是post的話可以在你的文章中新增header-img:"path/to/picture" for example:

---
title: {{ title }}
subtitle: <subtitle>
date: {{ date }}
header-img: "path/to/picture"
tags:
---

YenYuHsuan avatar Mar 20 '17 07:03 YenYuHsuan

设置了不起作用啊

paulyung541 avatar May 24 '17 06:05 paulyung541

我的也不能显示,测试了一下,hexo g生成的静态html文件中是能够正常解析header-img的,但是在本地环境不能解析

SuperChrisliu avatar Jun 25 '17 07:06 SuperChrisliu

这是hexo 的问题吗

SuperChrisliu avatar Jun 25 '17 07:06 SuperChrisliu

@paulyung541 @xchz 你們好 我想原本版主的意思應該是希望每篇文章有自己的背景圖,所以大家再新增post時會同步產生一個同名稱的文件夾,這時把想要的背景圖放到這個資料夾並且修改md檔的header-img就可以看到圖片了!

為了方便理解我這邊舉個例子:

  1. 當你使用指令hexo new post cool這時 hexo 會同時創建 cool.md 以及 cool/這個檔案及同名稱的資料夾。
  2. 這時將你想要的背景圖("cool-header.png")放到 cool/ 裡面。
  3. 這時修改 cool.md
---
title: {{ title }}
subtitle: <subtitle>
date: {{ date }}
header-img: "cool-header.png"
tags:
---
<!--你的內容-->

就會有header的圖片拉~

BTW打個小廣告,歡迎來我的網站看看 😄 BeanTech 謝謝指教

YenYuHsuan avatar Jul 01 '17 02:07 YenYuHsuan