上篇博文只是簡(jiǎn)單搭建起來(lái)了Hexo博客,現(xiàn)在來(lái)設(shè)置主要配置信息和修改主題icarus
Hexo配置
# Site
title: #主頁(yè)標(biāo)題
subtitle: #副標(biāo)題
description: #網(wǎng)站描述description主要用于SEO
keywords: #博客關(guān)鍵字
author: #作者,左下角顯示
language: zh_Hans # 選擇中文簡(jiǎn)體
timezone: 'Asia/Shanghai' #時(shí)區(qū):國(guó)內(nèi)選擇上海
# Url
url: http://yoursite.com #填自己的github pages網(wǎng)址
root: / #網(wǎng)站根目錄
permalink: :year/:month/:day/:title/ #文章的 永久鏈接 格式
permalink_defaults: #永久鏈接中各部分的默認(rèn)值
pretty_urls: #改寫(xiě) permalink 的值來(lái)美化 URL
trailing_index: false # 比如,一個(gè)頁(yè)面的永久鏈接是 http://example.com/foo/bar/index.html 是否在 永久鏈接中保留尾部的 index.html,設(shè)置為 false 時(shí)去除
trailing_html: true #是否在永久鏈接中保留尾部.html, 設(shè)置為 false 時(shí)去除
# Directory
source_dir: source #資源文件夾,這個(gè)文件夾用來(lái)存放內(nèi)容。
public_dir: public #公共文件夾,這個(gè)文件夾用于存放生成的站點(diǎn)文件。
tag_dir: tags #標(biāo)簽文件夾
archive_dir: archives #歸檔文件夾
category_dir: categories #分類(lèi)文件夾
code_dir: downloads/code #Include code 文件夾,source_dir 下的子目錄
i18n_dir: :lang #國(guó)際化(i18n)文件夾
skip_render: #跳過(guò)指定文件的渲染。匹配到的文件將會(huì)被不做改動(dòng)地復(fù)制到 public 目錄中。您可 使用 glob 表達(dá)式來(lái)匹配路徑。
# Writing
new_post_name: :year-:month-:day-:title.md #生成yyyy-MM-dd-博文名稱的名稱有助于我們管理自己的博 文。
default_layout: post #預(yù)設(shè)布局
titlecase: false #把標(biāo)題轉(zhuǎn)換為 title case
external_link: #在新標(biāo)簽中打開(kāi)鏈接
enable: true #在新標(biāo)簽中打開(kāi)鏈接
field: site #對(duì)整個(gè)網(wǎng)站(site)生效或僅對(duì)文章(post)生效
exclude: '' #需要排除的域名。主域名和子域名如 www 需分別配置
filename_case: 0 #把文件名稱轉(zhuǎn)換為 (1) 小寫(xiě)或 (2) 大寫(xiě)
render_drafts: false #顯示草稿
post_asset_folder: false #啟動(dòng) Asset 文件夾 new 文件的同時(shí),xxxx.md文件還有一個(gè)同名的文件夾
relative_link: false #把鏈接改為與根目錄的相對(duì)位址
future: true #顯示未來(lái)的文章
highlight:
enable: true #開(kāi)啟代碼塊高亮
line_number: true #顯示行數(shù)
auto_detect: false #如果未指定語(yǔ)言,則啟用自動(dòng)檢測(cè)
tab_replace: '' #用 n 個(gè)空格替換 tabs;如果值為空,則不會(huì)替換 tabs
wrap: true # 將代碼塊包裝到<table>
hljs: false # CSS類(lèi)使用hljs-*前綴
# Home page setting
# path: Root path for your blogs index page. (default = '')
# per_page: Posts displayed per page. (0 = disable pagination)
# order_by: Posts order. (Order by date descending by default)
index_generator:
path: ''
per_page: 10
order_by: -date
# Category & Tag
default_category: uncategorized #默認(rèn)分類(lèi)
category_map: #分類(lèi)別名
tag_map: #標(biāo)簽別名
# Metadata elements
meta_generator: true # Meta generator 標(biāo)簽。 值為 false 時(shí) Hexo 不會(huì)在頭部插入該標(biāo)簽
# Date / Time format
## Hexo uses Moment.js to parse and display date Hexo 使用 Moment.js 來(lái)解析和顯示時(shí)間
## You can customize the date format as defined in
## http://momentjs.com/docs/#/displaying/format/
date_format: YYYY-MM-DD #日期格式
time_format: HH:mm:ss #時(shí)間格式
use_date_for_updated: false #啟用以后,如果Front Matter中沒(méi)有指定 updated, post.updated 將會(huì)使用date的值而不是文件的創(chuàng)建時(shí)間。在Git工作流中這個(gè)選項(xiàng)會(huì)很有用
# Pagination
## Set per_page to 0 to disable pagination
per_page: 10 #每頁(yè)顯示的文章量 (0 = 關(guān)閉分頁(yè)功能)
pagination_dir: page #分頁(yè)目錄
# Include / Exclude file(s)
## include:/exclude: options only apply to the 'source/' folder
include: #Hexo 默認(rèn)會(huì)忽略隱藏文件和文件夾(包括名稱以下劃線和 . 開(kāi)頭的文件和文件夾,Hexo 的 _posts 和 _data 等目錄除外)。通過(guò)設(shè)置此字段將使 Hexo 處理他們并將它們復(fù)制到 source 目錄下。
exclude: #Hexo 會(huì)忽略這些文件和目錄
ignore: #Ignore files/folders
# Extensions
## Plugins: https://hexo.io/plugins/
## Themes: https://hexo.io/themes/
theme: icarus #當(dāng)前主題名稱。值為false時(shí)禁用主題
# Deployment
## Docs: https://hexo.io/docs/deployment.html
deploy: #部署部分的設(shè)置
type: git
repo: https://github.com/CodePandaes/CodePandaes.github.io.git #github中倉(cāng)庫(kù)地址
branch: master
替換icarus主題
icarus這個(gè)主題比較小眾,個(gè)人也很喜歡yilia這個(gè)主題,或者選擇官方主題,打開(kāi)git bash下載主題icarus
$ cd /d/WorkPlace/myHexo
$ git clone https://github.com/ppoffice/hexo-theme-icarus.git themes/icarus
下載好的主題在themes文件夾下

修改配置文件完成后,git bash中執(zhí)行命令hexo clean(清除緩存文件),然后執(zhí)行hexo g 和hexo s 重新發(fā)布
theme: icarus #在Hexo配置文件中把landscape切換為icarus
icarus配置
version: 2.6.0 #版本
favicon: /images/panda.ico #瀏覽器圖標(biāo)
meta: # Additional HTML meta tags in an array.
canonical_url: # canonical_url of your site
rss: # Path or URL to RSS atom.xml
logo: /images/logo.ico #logo
# Open Graph metadata
# https://hexo.io/docs/helpers.html#open-graph
open_graph:
# Facebook App ID
fb_app_id:
# Facebook Admin ID
fb_admins:
# Twitter ID
twitter_id:
# Twitter site
twitter_site:
# Google+ profile link
google_plus:
navbar: # 導(dǎo)航欄
# 菜單(顯示名稱:對(duì)應(yīng)文件夾)
menu:
主頁(yè): /
歸檔: /archives
分類(lèi): /categories
標(biāo)簽: /tags
關(guān)于我: /about
# github賬號(hào)
links:
Download on GitHub:
icon: fab fa-github
url: 'https://github.com/ppoffice/hexo-theme-icarus'
# 頁(yè)腳圖標(biāo)鏈接
footer:
# Links to be shown on the right of the footer section
links:
Creative Commons:
icon: fab fa-creative-commons
url: 'https://creativecommons.org/'
Attribution 4.0 International:
icon: fab fa-creative-commons-by
url: 'https://creativecommons.org/licenses/by/4.0/'
Download on GitHub:
icon: fab fa-github
url: 'https://github.com/ppoffice/hexo-theme-icarus'
# 文章顯示設(shè)置
article:
# Code highlight settings
highlight:
theme: atom-one-light # 代碼主題atom-one-light亮色,atom-one-dark暗色
clipboard: true # 顯示代碼copy按鈕
# Default folding status of the code blocks. Can be "", "folded", "unfolded"
fold: unfolded
thumbnail: true # 是否顯示文章主圖
readtime: true # 是否顯示估算閱讀時(shí)間
# Search plugin settings 搜索插件設(shè)置
search:
type: insight # 插件名
# 評(píng)論插件設(shè)置
comment:
#可選valine,disqus(科學(xué)上網(wǎng))等
# Name of the comment plugin
#type: valine
#app_id: 不為空
#app_key: 不為空
#notify: true
#verify: true
#placeholder:
# Name of the comment plugin
type:
# Donation entries 打賞功能
donate:
-
type: alipay # 支付寶
qrcode: '/' # 支付寶圖片URL
-
type: alipay # 微信
qrcode: '/' # 微信圖片URL
-
# 分享插件設(shè)置
share:
# Share plugin name 插件類(lèi)型,有多種,可選,自行百度
type:
# Sidebar settings.
sidebar:
# left sidebar settings 左側(cè)邊欄設(shè)置
left:
# 是否不隨頁(yè)面滾動(dòng)
sticky: true
# right sidebar settings 右側(cè)邊欄設(shè)置
right:
sticky: false
# Sidebar widget settings 邊欄小部件設(shè)置
widgets:
-
type: profile # 個(gè)人信息
position: left # 部件位置(左)
author: 程序熊貓 # 作者名(字符串)
author_title: Developer #作者身份描述(字符串)
location: 湖北·武漢 #作者當(dāng)前居住地
avatar: '/images/touXiang.jpeg' #頭像(可用本地圖片或網(wǎng)絡(luò)圖片鏈接)
gravatar: # 要在配置文件小部件中顯示的Gravatar的電子郵件地址
avatar_rounded: false #顯示圓形或方形的化身圖像
follow_link: 'https://github.com/CodePandaes' #關(guān)注我的鏈接,可設(shè)為你的GitHub主頁(yè)
#個(gè)人介紹部件底部圖標(biāo)社交鏈接
social_links:
Github:
icon: fab fa-github
url: 'https://github.com/CodePandaes'
Facebook:
icon: fab fa-facebook
url: 'https://facebook.com'
# Twitter:
# icon: fab fa-twitter
# url: 'https://twitter.com'
# Dribbble:
# icon: fab fa-dribbble
# url: 'https://dribbble.com'
# RSS:
# icon: fas fa-rss
# url: /
-
# Widget name 組件toc
type: toc
# Where should the widget be placed, left or right
position: left
-
# Widget name 標(biāo)簽
type: tag
# Where should the widget be placed, left or right
position: right
-
# Widget name 分類(lèi)
type: category
# Where should the widget be placed, left or right
position: right
-
# Widget name 標(biāo)簽云
type: tagcloud
# Where should the widget be placed, left or right
position: right
-
# Widget name 近期文章
type: recent_posts
# Where should the widget be placed, left or right
position: left
-
# Widget name 歸檔
type: archive
# Where should the widget be placed, left or right
position: right
-
# Widget name 外部鏈接
type: links
# Where should the widget be placed, left or right
position: right
# Links to be shown in the links widget
links:
阮一峰的博客: 'http://www.ruanyifeng.com/blog'
廖雪峰的博客: 'http://www.liaoxuefeng.com'</pre>
hexo博客常用插件請(qǐng)移步hexo常用的插件配置