魔改教程定位文件自行修改

首页配置文件

1·配置目录

\source\ _data\

ggl.yml 公告栏支持html代码

link.yml 友情链接

notice.yml 首页滚动三页公告栏

valine.json valine表情包配置

widget.yml 侧边栏文件

creativity.yml 开启创造力配置文件

shuanbian.yml 双边栏手动配置文件可以自动但是我懒得写

video.yml 视频页面配置

reward.yml 关于页打赏配置

sourec文件介绍

_data/ 数据文件
_posts/ 文章目录
about/ 关于页面
categories/ 分类
link/ 友情链接
messageboard/ 留言板
music/ 音乐
myself/ This is me
selfjs/ 选用js
tags/ 标签
talking/ 自言自语
timeline/ 日志
tuku/ 图库
xiance/ 相册

scaffolds文件

scaffolds文件是创建文章页面的模板

hexo new 文章名称

hexo new page 页面名称

重点文章模板介绍post.md

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
---
title: {{ title }}
date: {{ date }}
updated: {{ date }}
tags:
- 教程
- Hexo
- 主題
- butterfly
categories: 类别
keywords: 'hexo,butterfly,主題,doc,教程,文檔'
description: 描述 Butterfly安裝文檔-快速開始
top_img: 设置false不显示顶部图片
sticky: 数值越大越靠前有数支为置顶
cover: 首页封面图片链接
comments: true #评论开关

---



这里填写文章摘要

<!-- more -->
这里填写文章内容

scripts文件介绍

hexo如何在创建文章后编辑文章内容

\scripts\目录下有一个auto_open.js

文件这个文件是创建文章的同时打开编辑文章

1
2
3
4
var spawn = require('child_process').exec;
hexo.on('new', function(data){
spawn('start "C:\Program Files\Typora\Typora.exe" ' + data.path);
});

设置你的编辑器路径即可

切换背景

“blog\themes\butterfly\source\js\sun_moon.js”

首页切换(三只兔子)

“\blog\themes\butterfly\layout\includes\index1.pug”

推荐文章

1
2
3
4
---
title: 文章
ztys: 'color: #3d82ff;' # 字体颜色
---

更改推荐文章的内容修改\blog\themes\butterfly\layout\includes\index1.pug大概第99行的魔改为你的分类名称

双边栏

为手动配置

shuanbian.yml 双边栏手动配置文件可以自动但是我懒得写

如果想修改为自动获取分类或者标签页内容请修改

\blog\themes\butterfly\layout\includes\jinping.pug里的代码

1
2
3
4
5
6
7
8
9
10
each article, index in site.categories.findOne({name: '魔改'}).posts.data
if index < 9
.recent-post-san.touying
.post_cover.left_radius
a(href=url_for(article.path), title=article.title)
span.recent-post-top-text(onclick=`pjax.loadUrl("`+article.path+`")`)=i.xiao
img.post_bg.entered.loaded(src=url_for(article.cover) onerror="this.onerror=null,this.src='/img/404.png'")
.recent-post-info(onclick=`pjax.loadUrl("`+article.path+`")`)
a.article-title(href=url_for(article.path), title=article.title)= article.title
a(href=url_for(article.path)) 自定义内容

软件下载

\blog\themes\butterfly\layout\includes\appxiazai.pug

1
2
3
4
---
title: app软件下载图标
apptb: 'https://cdn.hlcssc.com/file/14237530/739234882/fbb13e/img/5.png'
---

删除多有的代码appxiazai.pug第8.9行和最后四行

幻灯片

1
2
3
4
---
title: 幻灯片
swiper_index: 4 # 数字越大越靠前
---

版权栏

“\blog\themes\butterfly\layout\includes\footer2.pug”