Writing & Organizing Content
- 創新md檔案至 ~/Documents/Hexo/你的資料夾名稱/source/_posts
1
$ hexo new a
創草稿md檔案至 ~/Documents/Hexo/你的資料夾名稱/source/_drafts
1
$ hexo new draft b
在瀏覽器預覽draft檔案
1
$ hexo server --draft
發表draft檔案,檔案也會從 ~/_draft 被移到 ~/_posts
1
$ hexo publish b
在 ~/Documents/Hexo/你的資料夾名稱/_config.yml中
改成1
default_layout: post
如此一來用1
default_layout: draft
就會預設創建草稿 (這才對吧,哪有人一new就發文ㄉ==)1
$ hexo new a
除了draft跟post以外,可以創單一個page
這檔案會被存在 <個人網址>/aboutme1
$ hexo new page aboutme
Scaffolds
- Scaffolds裡面放了三個檔案用來定義Front Matter (創建md檔時的前幾行)
- draft.md
- page.md
- post.md
以修改 ~/scaffolds/draft.md 為例 1
2
3
4---
title: {{ title }}
tags:
---1
2
3
4
5
6---
title: {{ title }}
author: Yuan
tags:
---
## H1 TEXT
Tags & Categories
在Front Matter新增 1
2
3
4
5---
tags: [tag1, tag2, tag3]
categories:
- [cat1, cat1.1]
---1
2$ hexo new page tags
$ hexo new page categories
1. source/tags/index.md 1
2
3
4
5
6---
title: tags
date: 產生當下時間
type: "tags"
comments: false
---1
2
3
4
5
6---
title: categories
date: 產生當下時間
type: "categories"
comments: false
---
Tag Plugins
可以用Plugins放codeblock或是iframe (youtube)之類的
1. 插入程式碼 1
2
3
4{% codeblock lang:python%}
code...
code...
{% endcodeblock %}1
2def add(x, y):
return x+y1
{% youtube I07XMi7MHd4%}