[toc]
hexo博客最常用的套路就是
hexo g; hexo s
本地预览,再更改,直到满意为止
hexo d
或者hexo g; hexo d
远程部署。
- hexo new “title” # 默认是post,如果博客名称有空格需要用双引号包裹起来
Front-matter
Front-matter 是 markdown 文件最上方以 —- 分隔的區域,用於指定個別檔案的變數。
Page Front-matter 用於 頁面 配置
Post Front-matter 用於 文章頁 配置
如果標注可選的參數,可根據自己需要添加,不用全部都寫在 markdown 裏
Page Front-matter(md渲染好像放在开头才有效果)


Post Front-matter
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
| --- title: date: updated: tags: categories: keywords: description: top_img: comments: cover: toc: toc_number: toc_style_simple: copyright: copyright_author: copyright_author_href: copyright_url: copyright_info: mathjax: katex: aplayer: highlight_shrink: aside: abcjs: noticeOutdate: ---
|

标签页
標籤頁文件名不一定是 tags, 例子中的 tags 只是一個示例.記得添加 type: “tags”
1.前往你的 Hexo 的根目錄
2.輸入 hexo new page tags
3.你會找到 source/tags/index.md 這個文件
修改這個文件:
1 2 3 4 5 6 7
| --- title: 標籤 date: 2018-01-05 00:00:00 type: 'tags' orderby: random order: 1 ---
|

分类页
hexo new page categories
1 2 3 4 5
| --- title: 分類 date: 2018-01-05 00:00:00 type: 'categories' ---
|
友链
hexo new page link
在 Hexo 根目錄中的 source/_data(如果沒有 _data 文件夾,請自行創建),創建一個文件 link.yml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
| - class_name: 友情鏈接 class_desc: 那些人,那些事 link_list: - name: Hexo link: https://hexo.io/zh-tw/ avatar: https://d33wubrfki0l68.cloudfront.net/6657ba50e702d84afb32fe846bed54fba1a77add/827ae/logo.svg descr: 快速、簡單且強大的網誌框架
- class_name: 網站 class_desc: 值得推薦的網站 link_list: - name: Youtube link: https://www.youtube.com/ avatar: https://i.loli.net/2020/05/14/9ZkGg8v3azHJfM1.png descr: 視頻網站 - name: Weibo link: https://www.weibo.com/ avatar: https://i.loli.net/2020/05/14/TLJBum386vcnI1P.png descr: 中國最大社交分享平台 - name: Twitter link: https://twitter.com/ avatar: https://i.loli.net/2020/05/14/5VyHPQqR6LWF39a.png descr: 社交分享平台
|
從 4.0.0 開始,支持從遠程加載友情鏈接,遠程拉取只支持 json。
注意: 選擇遠程加載後,本地生成的方法會無效。
在 source/link/index.md 這個文件的 front-matter 添加遠程鏈接
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
| [ { "class_name": "友情鏈接", "class_desc": "那些人,那些事", "link_list": [ { "name": "Hexo", "link": "https://hexo.io/zh-tw/", "avatar": "https://d33wubrfki0l68.cloudfront.net/6657ba50e702d84afb32fe846bed54fba1a77add/827ae/logo.svg", "descr": "快速、簡單且強大的網誌框架" } ] }, { "class_name": "網站", "class_desc": "值得推薦的網站", "link_list": [ { "name": "Youtube", "link": "https://www.youtube.com/", "avatar": "https://i.loli.net/2020/05/14/9ZkGg8v3azHJfM1.png", "descr": "視頻網站" }, { "name": "Weibo", "link": "https://www.weibo.com/", "avatar": "https://i.loli.net/2020/05/14/TLJBum386vcnI1P.png", "descr": "中國最大社交分享平台" }, { "name": "Twitter", "link": "https://twitter.com/", "avatar": "https://i.loli.net/2020/05/14/5VyHPQqR6LWF39a.png", "descr": "社交分享平台" } ] } ]
|
子页面
子頁面也是普通的頁面,你只需要 hexo n page xxxxx 創建你的頁面就行
然後使用標簽外掛 gallery,具體用法請查看對應的內容。
如果你想要使用 /photo/ohmygirl 這樣的鏈接顯示你的圖片內容.你可以把創建好的 ohmygirl 整個文件夾移到 photo 文件夾裏去
404 頁面
主題內置了一個簡單的 404 頁面,可在設置中開啟
1 2 3 4 5
| error_404: enable: true subtitle: '頁面沒有找到' background:
|