Hexo搭建butterfly博客---(二)安装主题及基础设置

Hexo搭建butterfly博客---(二)安装主题及基础设置

预览地址

https://blog.ffing.fun

本页仅对《blog目录》/_config.yml进行修改。

一,安装主题

1.安装butterfly主题依赖

#安装git依赖
npm install hexo-deployer-git --save
#安装主题依赖
npm install hexo-renderer-pug hexo-renderer-stylus --save

2.下载主题

项目地址:https://github.com/jerryc127/hexo-theme-butterfly

可网页下载:https://github.com/jerryc127/hexo-theme-butterfly/releases

https://qnimg.ffing.cn/wp-content/uploads/2023/03/image-12.png?imageView2/0/q/75|watermark/1/image/aHR0cHM6Ly9xbmltZy5mZmluZy5jbi9mbl9sb2dvLnBuZw==/dissolve/55/gravity/SouthEast/dx/0/dy/0

或git clone下载,2选项

git clone -b master https://github.com/jerryc127/hexo-theme-butterfly.git

3.启用主题

将下载的压缩包,解压到《blog目录》/theme/目录下,并重名为butterfly

https://qnimg.ffing.cn/wp-content/uploads/2023/03/image-13.png?imageView2/0/q/75|watermark/1/image/aHR0cHM6Ly9xbmltZy5mZmluZy5jbi9mbl9sb2dvLnBuZw==/dissolve/55/gravity/SouthEast/dx/0/dy/0

复制一份butterfly目录下的_config.yml到上级目录,并重命名为_config.butterfly.yml

https://qnimg.ffing.cn/wp-content/uploads/2023/03/image-14.png?imageView2/0/q/75|watermark/1/image/aHR0cHM6Ly9xbmltZy5mZmluZy5jbi9mbl9sb2dvLnBuZw==/dissolve/55/gravity/SouthEast/dx/0/dy/0

配置《blog目录》下的_config.yml,修改theme:butterfly

注意yml格式缩减!!!

https://qnimg.ffing.cn/wp-content/uploads/2023/03/image-15.png?imageView2/0/q/75|watermark/1/image/aHR0cHM6Ly9xbmltZy5mZmluZy5jbi9mbl9sb2dvLnBuZw==/dissolve/55/gravity/SouthEast/dx/0/dy/0

二,配置:站点信息语言等

# Site
title: FFing                    #站点名称
subtitle: ''                    #子名称
description: 'linux技术分享'      #站点说明
keywords:
author: Ldy                     #作者
language: zh-CN                 #站点语言
timezone: ''                    #站点时区
# URL
url: http://blog.ffing.fun      #站点链接(用于分享地址)
https://qnimg.ffing.cn/wp-content/uploads/2023/03/image-16.png?imageView2/0/q/75|watermark/1/image/aHR0cHM6Ly9xbmltZy5mZmluZy5jbi9mbl9sb2dvLnBuZw==/dissolve/55/gravity/SouthEast/dx/0/dy/0

三,配置:GIT地址

在末尾修改deploy配置项

deploy:
  type: git
  repo: ###git仓库地址
  branch: ###github的默认分支是main,gitee默认分支为master
https://qnimg.ffing.cn/wp-content/uploads/2023/03/image-17.png?imageView2/0/q/75|watermark/1/image/aHR0cHM6Ly9xbmltZy5mZmluZy5jbi9mbl9sb2dvLnBuZw==/dissolve/55/gravity/SouthEast/dx/0/dy/0

四,其他配置

修改首页显示文章数量

https://qnimg.ffing.cn/wp-content/uploads/2023/03/image-19.png?imageView2/0/q/75|watermark/1/image/aHR0cHM6Ly9xbmltZy5mZmluZy5jbi9mbl9sb2dvLnBuZw==/dissolve/55/gravity/SouthEast/dx/0/dy/0

添加的永久链接,需安装hexo-abbrlink插件

#永久链接
npm install hexo-abbrlink --save
https://qnimg.ffing.cn/wp-content/uploads/2023/03/image-18.png?imageView2/0/q/75|watermark/1/image/aHR0cHM6Ly9xbmltZy5mZmluZy5jbi9mbl9sb2dvLnBuZw==/dissolve/55/gravity/SouthEast/dx/0/dy/0

添加的音乐播放器及algolia搜索

#音乐播放器插件
npm install --save hexo-tag-aplayer
#algolia搜索插件
npm install hexo-algoliasearch --save
https://qnimg.ffing.cn/wp-content/uploads/2023/03/image-20.png?imageView2/0/q/75|watermark/1/image/aHR0cHM6Ly9xbmltZy5mZmluZy5jbi9mbl9sb2dvLnBuZw==/dissolve/55/gravity/SouthEast/dx/0/dy/0

添加的统计配置

#统计插件
npm i hexo-butterfly-charts --save
https://qnimg.ffing.cn/wp-content/uploads/2023/03/image-21.png?imageView2/0/q/75|watermark/1/image/aHR0cHM6Ly9xbmltZy5mZmluZy5jbi9mbl9sb2dvLnBuZw==/dissolve/55/gravity/SouthEast/dx/0/dy/0
good good study, day day up!

发表评论

textsms
account_circle
email

Hexo搭建butterfly博客---(二)安装主题及基础设置
预览地址 https://blog.ffing.fun 本页仅对《blog目录》/_config.yml进行修改。 一,安装主题 1.安装butterfly主题依赖 #安装git依赖 npm install hexo-deployer-git …
扫描二维码继续阅读
2023-03-10