大佬们的魔改记录

写作

Butterfly 主题魔改样式查阅,ZYKJ's Blog

修改顶端菜单栏字体大小

Butterfly 主题更新总结,自定义样式

在路径 themes\Butterfly\source\css\_layout\head.styl下查找.site-page,设置 font-size 为.90em

修改页面宽度

点击查看Hexo Butterfly宽屏适配指北

关于页面

点击查看

随机文章

点击查看Hexo的Butterfly魔改:随机网页跳转(无缝版)

复制弹窗

点击查看hexo主题butterfly顶部复制提示弹窗

注意:

  • 在主题配置文件中把snackbar打开
  • 打开Pjax

Pjax能够实现页面的局部刷新而非整体重载资源,在一定程度上能够减少网站反复加载重复资源,从而优化访问体验。如果不开pjax,每次点击都会提示欢迎光临

为你的Butterfly添加顶部加载进度条

为你的Butterfly添加顶部加载进度条

网站底部运行时间

https://blog1.4t.pw/posts/28ae4987.html

hexo部署到vps

https://blog.zhheo.com/p/12a4e7e6.html

https://blog.gmcj0816.top/posts/47c1249e/

标签上标

Butterfly标签云增加文章数上下标

\themes \butterfly\scripts \helpers\page.js搜索 cloudTags

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
26
27
28
29
30
31
32
33
hexo.extend.helper.register('cloudTags', function (options = {}) {
const theme = hexo.theme.config
const env = this
let source = options.source
const minfontsize = options.minfontsize
const maxfontsize = options.maxfontsize
const limit = options.limit
const unit = options.unit || 'px'

let result = ''
if (limit > 0) {
source = source.limit(limit)
}

const sizes = []
source.sort('length').forEach(tag => {
const { length } = tag
if (sizes.includes(length)) return
sizes.push(length)
})

const length = sizes.length - 1
source.forEach(tag => {
const ratio = length ? sizes.indexOf(tag.length) / length : 0
const size = minfontsize + ((maxfontsize - minfontsize) * ratio)
let style = `font-size: ${parseFloat(size.toFixed(2))}${unit};`
const color = 'rgb(' + Math.floor(Math.random() * 201) + ', ' + Math.floor(Math.random() * 201) + ', ' + Math.floor(Math.random() * 201) + ')' // 0,0,0 -> 200,200,200
style += ` color: ${color}`
- result += `<a href="${env.url_for(tag.path)}" style="${style}">${tag.name}</a>`
+ result += `<a href="${env.url_for(tag.path)}" style="${style}">${tag.name}<sup>${tag.length}</sup></a>`
})
return result
})

gulp压缩

https://blog.jayhrn.com/posts/49b73b87.html

备案

https://blog.gmcj0816.top/posts/25c2e781/

禁用右键菜单

https://www.jianshu.com/p/a7be27c7d56d

引入js

1
2
3
4
window.oncontextmenu=function(e){
//取消默认的浏览器自带右键 很重要!!
e.preventDefault();
}

文章标题在正文区域

设置配置文件

disable_top_img: true

spawn错误

https://blog.zhheo.com/p/128998ac.html

SpawnFailed的解决方法,小豆同学

  • 解决方法零:重!启!电!脑!(´。_。`)

  • 解决方法一:

    1
    2
    3
    # 第一个就是你的邮箱,第二个就是你的用户名
    git config --global user.email "2673065011@qq.com"
    git config --global user.name "210173313"
  • 解决方法二:

    1
    2
    3
    4
    5
    6
    # 删除.deploy_git文件夹,输入:
    git config --global core.autocrlf false
    # 然后,依次执行:
    hexo clean
    hexo g
    hexo d
  • 解决方法三:

    1
    2
    3
    4
    5
    6
    7
    8
    9
    # 打开_config.yml配置文件,修改以下内容

    deploy:
    type: 'git'
    repo: https://github.com/yourname/yourname.github.io.git
    branch: master

    # 其中的repo修改为
    repo: git@github.com:yourname/yourname.github.io.git

留言板

https://akilar.top/posts/e2d3c450/

pjax相关知识

https://akilar.top/posts/3b78b69a/

如何隐藏文章

如何优雅隐藏 Hexo 文章,cc的部落格

谷歌广告

Google Adsense 配置手册,cc的部落格

butterfly主题作者的配置文件

jerryc127

butterfly魔改开源主题

blog-butterfly

解决 GitHub Actions 自动部署 Hexo 时文章更新日期发生变化

点击跳转至小嘉的部落格