Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

背景图片怎么设置? #49

Open
xingchenfengn opened this issue Jan 18, 2017 · 5 comments
Open

背景图片怎么设置? #49

xingchenfengn opened this issue Jan 18, 2017 · 5 comments

Comments

@xingchenfengn
Copy link

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

@YenYuHsuan
Copy link

YenYuHsuan commented Mar 20, 2017

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

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

@paulyung541
Copy link

设置了不起作用啊

@SuperChrisliu
Copy link

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

@SuperChrisliu
Copy link

这是hexo 的问题吗

@YenYuHsuan
Copy link

YenYuHsuan commented Jul 1, 2017

@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
謝謝指教

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants