0%

[筆記] Hexo - nexT 基礎配置 (一)

自己在建置的時候查了很多資料,整理完希望幫助到有需要的人
此篇文章主要是修改 _config.yml 裡的設置

新建文章分類頁面 (Categories)

1
hexo new page categories

修改 source/categories/index.md

1
2
3
4
5
6
---
title: categories
date: 產生當下時間
type: "categories"
comments: false
---

文章增加分類,只要在 categories 後面加入類別

1
categories: [categorie1, categorie2, ...]

新建文章標籤頁面 (Tags)

1
hexo new page tags

修改 source/tags/index.md

1
2
3
4
5
6
---
title: tags
date: 產生當下時間
type: "tags"
comments: false
---

文章增加標籤,只要在 tags 後面加入標籤

1
tags: [tag1, tag2, ...]

下列方式會在文章中顯示 tags

1
2
3
4
5
6
7
8
9
---
title: '[筆記] GitHub pages + Hexo 搭建 Blog (Mac)'
date: 2020-09-11 18:39:59
tags:
- tag1
- tag2
- tag3
- tag4
---

圖片

設置首頁不顯示全文

Next默認會顯示全文,個人不是很喜歡,首頁會有點太長

  • 修改配置
    印象安裝時 default 應該就是true
    1
    excerpt_description:  true
    • 方法一: 在文章中寫 desctiption

      1
      2
      3
      4
      5
      --- 
      title: '文章標題'
      date: 產生當下時間
      description: '會顯示在首頁的摘要,其餘的會隱藏'
      ---
    • 方法二:
      在文章中想截斷的地方加上 <!--more-->

文章中 note 樣式

  • default:

    1
    2
    style: simple
    icons: false

    圖片

  • 修改後

    1
    2
    3
    note:
    style: flat
    icons: true

    default note

    primary note

    success note

    info note

    warning note

    danger note

    使用方法:(跟 HackMD 滿像的)

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    {% note default %}
    default note
    {% endnote %}

    {% note primary %}
    primary note
    {% endnote %}

    {% note success %}
    success note
    {% endnote %}

    {% note info %}
    info note
    {% endnote %}

    {% note warning %}
    warning note
    {% endnote %}

    {% note danger %}
    danger note
    {% endnote %}

Scheme 設定

在 NexT 中以下幾種 Scheme 可選擇,預設主題為Muse
修改 theme/next/_config.yml,去掉註解 ‘#’ 即可

1
2
3
4
#scheme: Muse
#scheme: Mist
#scheme: Pisces
scheme: Gemini

開啟社群帳號連結

修改 theme/next/_config.yml,去掉註解 ‘#’ 即可

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# Social Links
# Usage: `Key: permalink || icon`
# Key is the link label showing to end users.
# Value before `||` delimiter is the target permalink, value after `||` delimiter is the name of Font Awesome icon.
social:
#GitHub: https://github.com/yourname || fab fa-github
#E-Mail: mailto:yourname@gmail.com || fa fa-envelope
#Weibo: https://weibo.com/yourname || fab fa-weibo
#Google: https://plus.google.com/yourname || fab fa-google
#Twitter: https://twitter.com/yourname || fab fa-twitter
#FB Page: https://www.facebook.com/yourname/ || fab fa-facebook
#StackOverflow: https://stackoverflow.com/yourname || fab fa-stack-overflow
#YouTube: https://youtube.com/yourname || fab fa-youtube
#Instagram: https://instagram.com/yourname || fab fa-instagram
#Skype: skype:yourname?call|chat || fab fa-skype

大頭貼設定

修改 theme/next/_config.yml,去掉註解 ‘#’ 即可

1
2
3
4
avatar:
url: #/images/avatar.gif
# If true, the avatar will be dispalyed in circle.
rounded: true