前言
前段时间给博客换了个域名同时更新了博客的Next主题,最新版的7.1,之前是5.x版本。改动太多就直接clone,然后对照之前的一点点修改吧。这里简单记录一下个性化的设置。
直接在配置文件修改的地方
- 网站图标
favicon:
将图片定位到/theme/next/source/images - 文章版权
creative_commons:
修改post属性为true - 备案
beian:
- 菜单定制
menu:
- 社交
social:
- 友链
links: - 头像
avatar:
- 阅读全文按钮
auto_excerpt:
read_more_btn:
- 字符统计信息
symbols_count_time:
需要安装插件
同时根目录配置文件
symbols_count_time:
- 打赏
reward_settings:
enable: true
animation: true
comment: 自定义显示的内容
下面位置放入你的二维码
reward:
wechatpay: /images/wechatpay.jpg
alipay: /images/alipay.jpg
- Valine评论系统
# Valine
# You can get your appid and appkey from https://leancloud.cn
# More info available at https://valine.js.org
valine:
- 本地搜索
local_search:
- 代码复制按钮
codeblock:
- 阅读人数
busuanzi_count:
这些都是我自己用到了一下配置,主题配置文件还有很多地方,大家可以去仔细看看
站点根目录配置文件和其他的地方
- 汉化
language: zh-CN
之前版本是zh-Hans 新版本更新了 - 网站标题和描述
title:
description:
- 新建博文时文件名添加当前时间
new_post_name: :year-:month-:day-:title.md
- 添加网站萌宠
https://github.com/xiazeyu/live2d-widget.js
https://l2dwidget.js.org/docs/class/src/index.js~L2Dwidget.html#instance-method-init
- 给文章加密
themes/next/layout/_partials/head/head.swig
在第5行,也就是第一个if前添加下面代码
<script>
(function(){
if('{{ page.password }}'){
if (prompt('请输入文章密码') !== '{{ page.password }}'){
alert('密码错误!');
history.back();
}
}
})();
</script>
然后再文章开头的— ---内添加password: 密码 //记得有空格
- 修改全局背景
/theme/next/source/images目录放入你的背景图片命令为background.jpg
然后在/theme/next/source/css/_custom/custom.sty中添加下面代码
// Custom styles.
@media screen and (min-width:1200px) {
body {
background-image:url(/images/background.jpg);
background-repeat: no-repeat;
background-attachment:fixed;
background-position:50% 50%;
background-size:cover
}
#footer a {
color:#eee;
}
}
暂时就想起来这么多,以后会一点点完善的
关于搭建博客可以看我的另一篇文章这是链接
本人博客链接
https://sxz799.ml