Hexo NexT _config.yml 設定
NexT 主題
NexT 提供了 4 個不同的主題選擇。
1  | # Schemes  | 


NexT 暗黑模式
1  | # Dark Mode  | 
- darkmode: 設定是否開啟暗黑模式,開啟則設定為 
true。 
favicon 設定
要為您的部落格設置 favicon,請將 favicon 圖片放在 themes/next/source/images 目錄下。根據網站風格設計 favicon,並在 _config.yml 中配置如下:
1  | favicon:  | 
- small: 16x16 像素的 favicon 圖片,通常用於瀏覽器標籤。
 - medium: 32x32 像素的 favicon 圖片,適用於更大尺寸的顯示需求。
 - apple_touch_icon: 用於 iOS 設備的網頁圖標,建議使用 180x180 像素的圖片。
 - safari_pinned_tab: 用於 Safari 瀏覽器的固定標籤頁圖標,通常為 32x32 像素的 SVG 圖片。
 - android_manifest: 可選,Android 網頁應用程序的 manifest 文件位置,若有使用此功能可配置此選項。
 
確保 favicon 的設置符合您的網站風格,使您的網站在各種設備上都能夠顯示一致且專業的外觀。
CC 授權條款
1  | # Creative Commons 4.0 International License.  | 
post設置為true會在文章底部顯示 CC 授權條款。sidebar設置為true會在側邊欄顯示 CC 授權條款。
選單設定
1  | menu:  | 

側邊選單位置
預設為 left,依照個人喜好修改顯示位置
1  | sidebar:  | 
頭像
1  | # Sidebar Avatar  | 
![]()
社交平台設定
1  | social:  | 

footer 設定

1  | footer:  | 

文章元數據顯示設置
這段配置允許你自訂文章頁面的元數據顯示選項。

1  | # Post meta display settings  | 
item_text: true:顯示項目文本。created_at: true:顯示文章的創建日期。updated_at:enable: true:顯示最後更新日期。another_day: true:若啟用,會顯示與創建日期不同的日期(需配合enable: true使用)。
categories: true:顯示文章的分類。
修改程式碼顯示樣式
1  | codeblock:  | 
高量設定
可以參考以下設置。可用的主題列表在這裡:Code Highlight Themes
1  | theme:  | 

複製按鈕設定
要啟用複製按鈕,請將 enable 設為 true,此時 style 設定才會生效。
1  | copy_button:  | 

代碼摺疊
1  | fold:  | 

返回頂部
1  | back2top:  | 
- 將 
sidebar設定為true可以在側邊欄的個人資訊區塊中顯示回到頂部按鈕。 

- 將 
scrollpercent設定為true會顯示閱讀進度百分比。 
閱讀進度條
1  | # Reading progress bar  | 
enable: 設定是否開啟進度條,開啟則設定為true。start_at: 設定進度條開始位置,選擇left或right。position: 設定進度條在頂部或底部顯示。reversed: 是否反轉進度條。color: 設定進度條顏色。height: 設定進度條高度。
GitHub 右上角 ICON
1  | # `Follow me on GitHub` banner in the top-right corner.  | 
![]()
Note 設定
1  | note:  | 
以下是 Note 標籤的樣式:



icons 的顯示可以根據個人喜好選擇是否啟用。
如果您不喜歡樣式中的背景色,可以調整 light_bg_offset 來改變背景色的亮度。
Tabs 設定
1  | tabs:  | 
sticky: 設置導航欄是否在滾動時固定在頁面頂部。設置為false表示導航欄不會固定。transition: 控制標籤頁和標籤的過渡效果。將tabs和labels設置為true以啟用平滑過渡。
載入進度條設定
編輯
theme/_config.yml文件,啟用並配置進度條:1
2
3
4
5
6
7
8
9
10
11# 詳細資訊: https://github.com/CodeByZach/pace
pace:
enable: true
# 可選顏色:
# black | blue | green | orange | pink | purple | red | silver | white | yellow
color: blue
# 可選主題:
# 詳細資訊: https://codebyzach.github.io/pace/#get-started-snippet
# big-counter | bounce | barber-shop | center-atom | center-circle | center-radar | center-simple
# corner-indicator | fill-left | flat-top | flash | loading-bar | mac-osx | material | minimal
theme: minimal

搜尋欄位設定
安裝搜尋插件:
1
npm install hexo-generator-search --save
編輯根目錄下的
_config.yml文件,加入搜尋欄位設定:1
2
3
4
5
6
7
8
9# Extensions
## Plugins: https://hexo.io/plugins/
## Themes: https://hexo.io/themes/
theme: next
## 加入搜尋欄位
search:
path: search.json
field: post編輯
theme/next/_config.yml文件以啟用本地搜尋將
local_search的enable設為true,並根據需要調整其他設定:1
2
3
4
5
6
7
8
9
10# Local Search
# Dependencies: https://github.com/next-theme/hexo-generator-searchdb
local_search:
enable: true
# 每篇文章顯示的搜尋結果數量,設為 -1 以顯示所有結果
top_n_per_article: 1
# 是否取消 HTML 字符串的轉義為可讀文本
unescape: false
# 頁面加載時是否預加載搜尋數據
preload: false