欢迎查看我的个人博客
Hexo 支持个性化定制主题,可以根据自己的喜好进行修改。Hexo主题可以从官网或者GitHub查看更多主题。
一、安装主题
在博客的根目录下打开git bash克隆主题。
git clone https://github.com/litten/hexo-theme-yilia.git themes/yilia
更改为你选择的主题地址theme/(名字。建议和原主题名一致)
等待下载完成。执行:
vim _config.yml
或者在 themes/你的主题/_config.yml 文件夹下使用文本编辑器打开。修改
theme: yilia(你下载的主题名称)
二、主题配置
现在主题是更改过来了,但还有许多细节需要处理,比如说你需要修改头像等等。
- 首先进入到根目录下的 themes\yilia 文件夹
# ---------------------------------------------------------------
# Site Information Settings
# 网站信息配置
# ---------------------------------------------------------------
# Header Menu
# 主菜单
menu:
Home: /
Archives: /archives
Categories: /categories
Tags: /tags
About: /about
rss: /atom.xml
# Set default keywords (Use a comma to separate)
# 设置默认关键字
keywords: ""
# Put your favicon.ico into `hexo-site/themes/hipaper/source/` directory.
# 把你的图标放在***
favicon: css/images/ActiveBlog.ico
# Put your avatar.jpg into `hexo-site/themes/hipaper/source/` directory.
# url is target link (E.g. `url: https://hexo.io/logo.svg` or `url: css/images/mylogo.jpg`)
avatar:
enable: false
width: 124
height: 124
bottom: 10
url: https://hexo.io/logo.svg
# AboutPage background, support multiple images.
# about_big_image: [css/images/pose01.jpg, https://images.unsplash.com/photo-1464306208223-e0b4495a5553?dpr=1&auto=format&fit=crop&w=1500&h=1000&q=80&cs=tinysrgb&crop=&bg=]
# Homepage thumbnail
# 网页的缩略图
random_thumb: false
# Content
fancybox: true
# Sidebar
# 侧边栏
sidebar: right
widgets:
#- search
- social
- recent_posts
- category
- tags
- tagcloud
- archive
# Social Links
# Key is the name of FontAwsome icon.
# 关键是fontawsome图标的名称。
# Value is the target link (E.g. GitHub: https://github.com/MSK0379)
social:
Github: https://github.com/MSK0379
Envelope: mailto:17629007803@163.com
# Facebook:
# Google-plus:
# Instagram:
# Search
search:
insight: true # you need to install `hexo-generator-json-content` before using Insight Search
swiftype: # enter swiftype install key here
baidu: false # you need to disable other search engines to use Baidu search, options: true, false
# comment ShortName, you can choose only ONE to display.
duoshuo_shortname:
disqus_shortname: MSK0379
# Code Highlight theme
# Available value:
# default | normal | night | night eighties | night blue | night bright
# https://github.com/chriskempson/tomorrow-theme
highlight_theme: normal
# widget behavior
archive_type: 'monthly'
show_count: true
# Google Webmaster tools verification setting
# See: https://www.google.com/webmasters/
google_site_verification:
baidu_site_verification:
qihu_site_verification:
# Miscellaneous
google_analytics:
gauges_analytics:
baidu_analytics:
tencent_analytics:
busuanzi_analytics: true
twitter:
google_plus:
fb_admins:
fb_app_id:
接着就自动部署一下:
npm install hexo-deployer-git --save
最后发布:
$ hexo clean && hexo g && hexo d
也可以在本地先预览以下。主题设置完毕,可以快乐玩耍啦。