部署系统环境 ArchLinux x64 Termux(手机) 开始部署 一、安装Node.js 1.安装前先更新
2.安装Node.js
3.安装完成之后检查是否安装成功
二、安装Git 安装Git
配置Git 1 2 3 4 5 6 7 git config --global user.name "username" git config --global user.email "username@example.com" ssh-keygen -t rsa -C youremail@example.com less ~/.ssh/id_rsa.pub
1.安装之前先更新 1 sudo apt-get update &apt-get upgrade
2.安装Node.js 1 sudo apt-get install nodejs
3.安装完成之后检查是否安装成功
二、安装Git 安装Git 1 sudo apt-get install git
配置Git 1 2 3 4 5 6 7 git config --global user.name "username" git config --global user.email "username@example.com" ssh-keygen -t rsa -C youremail@example.com less ~/.ssh/id_rsa.pub
三、安装Hexo 1.终端输入 1 sudo npm install hexo-cli -g
2.检查Hexo部署是否成功
四、部署hexo博客环境 1.初始化Hexo
注:myblog为部署的Hexo的文件夹名
2.Hexo一键三连 1 hexo clean & hexo g & hexo s
注:
命令
说明
hexo clean
不能缩写,清除缓存文件
hexo g
hexo generate 的缩写,生成静态文件
hexo s
hexo server 的缩写,启动本地服务,用于预览主题
3.查看部署效果 1.打开浏览器,地址栏输入localhost:4000 ,回车确认网页是否加载正常 2.成功后,回到终端,使用Ctrl +C 退出本地服务
4.部署到Github仓库🏚️ 1.注册github账号:GitHub 2.新建username.github.io仓库: 注册成功后,在github首页单击头像 ->Your repositories 在自己的 GitHub 账号下创建一个新的仓库,命名为 username.github.io (username是你的账号名)。
3.在Github中添加生成的SSH Key a.打开GitHub 网页 单击头像 ->settings ,在设置页面找到SSH and GPG keys b.单击New SSH key c.在Key内容框里输入我们在部署Git时生成的id_rsa.pub公钥内容,保存。 d.保存后,在terminal中测试sshkey是否添加成功, 输入
正常输出:
1 2 3 4 5 6 The authenticity of host 'github.com (207.97.227.239)' can't be established. RSA key fingerprint is 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48. Are you sure you want to continue connecting (yes/no)? # 此处请输入yes Hi username! You' ve successfully authenticated, but GitHub does notprovide shell access.
更多错误bug可详细查询大佬Akilar的文章Ubuntu+Hexo+github搭建个人博客
4.配置hexo部署插件内容: 在博客根目录下,右键 ->打开终端 ,输入:
1 sudo npm install hexo-deployer-git --save
打开博客根目录下的_config.yml,修改底部的deploy配置项。如果没有找到deploy配置项,则自己添加:
1 2 3 4 5 6 7 8 9 10 deploy: type: git repo: github: url: git@github.com:username/username.github.io.git branch: master github: git@github.com:username/username.github.io.git,master
这里deploy前面不要有空格,而所有:后面都要有空格。对齐缩进情况要严格按照示例来写。yml编译对缩进要求很严格,所以格式很重要。
5.把本地hexo博客内容提交到git仓库 若以上内容已经准确配置,在博客根目录下右键 ->打开终端 ,输入:
1 2 3 sudo hexo cleansudo hexo generatesudo hexo deploy
不出意外,就可以在浏览器上输入https://username.github.io访问你的博客了。 (记得替换username为自己的用户名。)
五、为博客更换Anzhiyu主题 1.拉取主题(Github) 1 git clone -b main https://github.com/anzhiyu-c/hexo-theme-anzhiyu.git themes/anzhiyu
如遇安装不上可以使用以下url代理安装
1 git clone -b main https://ghproxy.com/https://github.com/anzhiyu-c/hexo-theme-anzhiyu.git themes/anzhiyu
2.应用主题 打开 Hexo 根目录下的config.yml , 找到以下配置项,把主题改为anzhiyu
3.安装pug
和stylus
渲染插件 1 npm install hexo-renderer-pug hexo-renderer-stylus --save
无法安装可以使用cnpm进行安装
1 npm install hexo-renderer-pug hexo-renderer-stylus --save --registry=http://registry.npmmirror.com
4.覆盖配置 1 cp -rf ./themes/anzhiyu/_config.yml ./_config.anzhiyu.yml
只要存在于_config.anzhiyu.yml 的配置都是高优先级,修改原_config.yml 是无效的。
每次更新主题可能存在配置变更,请注意更新说明,可能需要手动对_config.anzhiyu.yml 同步修改。
想查看覆盖配置有没有生效,可以通过hexo g --debug 查看命令行输出。
如果想将某些配置覆盖为空,注意不要把主键删掉,不然是无法覆盖的
5.页面配置 在 Hexo 博客根目录下打开终端,输入
1 2 3 4 5 6 7 hexo new page namepage
标签页面 关于页面 分类页面 友情链接页面 首页即刻说说页面 留言板页面 我的装备页面 追番/追剧页面 相册页面 音乐馆页面 小空调页面 1 2 3 4 5 6 7 --- title: 标签 date: 2023-06-10 23:32:54 type: "tags" comments: false top_img: false ---
参数
解释
type
【必须】页面类型,必须为 tags
comments
【可选】是否显示评论
top_img
【可选】是否显示顶部图
orderby
【可选】排序方式 :random/name/length
order
【可选】排序次序: 1, asc for ascending; -1, desc for descending
博客根目录/source/about/index.md 1 2 3 4 5 6 7 8 9 --- title: 关于 date: 2023-06-11 00:01:36 aside: false top_img: false background: "#f8f9fe" comments: false type: "about" ---
博客根目录/source/_data/about.yml 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 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 - class_name: 关于页 subtitle: 路为纸,地成册,行做笔,心当墨。✨ avatarImg: https://s2.loli.net/2023/06/26/Wox4YqVQzy9RehX.jpg avatarSkills: left: - 🤖️ 数码科技爱好者 - 🔍 分享与热心帮助 - 🏠 智能家居小能手 - 🔨 设计开发一条龙 right: - 专修交互与设计 🤝 - 脚踏实地行动派 🏃 - 团队小组发动机 🧱 - 壮汉人狠话不多 💢 name: 樂乐 description: 是一名 学生 aboutsiteTips: tips: 追求 title1: 源于 title2: 热爱而去 感受 word: - 学习 - 生活 - 程序 - 体验 helloAbout: Hello there! skillsTips: tips: 技能 title: 开启创造力 careers: tips: 生涯 title: 无限进步 list: - desc: EDU,海东市第一中学 color: "#0eb83a" - desc: EDU,电子信息科学与技术专业 color: "#357ef5" img: https://s2.loli.net/2023/06/26/DLRyFlfcvZVKaiS.png statistic: link: /archives text: 文章隧道 cover: https://s2.loli.net/2023/06/26/3GcKZJFWx6dOulb.jpg map: title: 我现在住在 StrengthenTitle: 中国,青海省,海东市 background: https://s2.loli.net/2023/06/26/f2knxLCUB9yFQXr.png backgroundDark: https://s2.loli.net/2023/06/26/fFanQqhtogC9NJL.png selfInfo: selfInfoTips1: 生于 selfInfoContentYear: 2004 selfInfoTips2: 青海民族大学 selfInfoContent2: 电子信息科学与技术 selfInfoTips3: 现在职业 selfInfoContent3: 大一学生👨🎓 personalities: author_ name: 逻辑学家 personality_type: INTP-A / INTP-T photo_url: https://s2.loli.net/2023/06/26/f2knxLCUB9yFQXr.png # photo_url: https://img02.anzhiy.cn/adminuploads/1/2022/09/24/632e9643611ec.jpg personality_img: https://www.16personalities.com/static/images/premium/localized/personality-profiles/ch/logician.svg?v=2 name_url: https://www.16personalities.com/ch/intp-人格 maxim: maxim_tips: 座右铭 maxim_top: 悟已往之不谏, maxim_bottom: 知来者之可追。 buff: buff_tips: 爱好 buff_top: 热爱摄影 buff_bottom: 擅长CSS HTML前端开发 game: game_tips: 爱好游戏 game_title: 原神 game_uid: "UID: 291633762" game_bg: https://bu.dusays.com/2023/04/22/64433bf26e25d.webp comic: comic_tips: 爱好番剧 comic_title: 追番 comic_list: - name: 中国奇谭 href: https://www.bilibili.com/bangumi/media/md28235401/ cover: https://s2.loli.net/2023/08/03/qnPpySQ7IhkLTMH.png - name: 三体 href: https://www.bilibili.com/bangumi/media/md4315402/ cover: https://s2.loli.net/2023/08/03/OuisG6XvUzhBSay.png - name: 第一序列 href: https://www.bilibili.com/bangumi/media/md28235353/ cover: https://s2.loli.net/2023/08/03/TwoF61iyHD3PZ9b.png - name: 梦塔·雪谜城 href: https://www.bilibili.com/bangumi/media/md23692/ cover: https://s2.loli.net/2023/08/03/bkUsMRHlAzGp7IV.jpg - name: 擅长捉弄的高木同学 第三季 href: https://www.bilibili.com/bangumi/media/md28235860/ cover: https://s2.loli.net/2023/08/03/62QRCSmcUhwxuyV.jpg like: like_tips: 关注偏好 like_title: 数码科技 like_bg: https://s2.loli.net/2023/06/26/OIYbD5ZfPyvemnB.webp like_bottom: 手机、电脑软硬件 music: music_tips: 音乐偏好 music_title: 薛之谦、民谣、华语流行 music_bg: http://p1.music.126.net/LCWqYYKoCEZKuAC3S3lIeg==/109951165034938865.jpg?imageView=1&type=webp&thumbnail=1125x0 music_link: /music reward_list: - name: 長塵仅染,謙自樂来 amount: 5.2 datatime: 2023-05-03 - name: 半城繁華半城傷づ。 amount: 9.8 datatime: 2020-09-08 extra: boolean
参数
备选值/类型
解释
class_name
关于页
【必须】页面类
subtitle
string
【必须】副标题
avatarImg
url
【必须】头像链接
name
string
【必须 作者名称
description
string
【必须】描述
aboutsiteTips
object
aboutsiteTips.tips
string
【必须】站点关于提示性文字
aboutsiteTips.title1
string
【必须】站点关于标题文字 1
aboutsiteTips.title2
string
【必须】站点关于标题文字 2
aboutsiteTips.word
list
【必须】站点关于标题滚动文字
helloAbout
string
【必须】hello 文字
skillsTips
object
【必须】技能相关配置
skillsTips.tips
string
【必须】技能提示文字
skillsTips.title
string
【必须】技能标题
careers
object
【必须】生涯相关配置
careers.tips
string
【必须】生涯提示性文字
careers.title
string
【必须】生涯标题
careers.list
list
【可选】生涯 item
careers.list.desc
string
【可选】生涯 item 描述
careers.list.color
string
【可选】生涯 item 圆圈颜色
careers.img
string
【必须】生涯底部图片
statistic
object
【必须】统计数据相关配置
statistic.link
url
【必须】统计数据按钮前往链接
statistic.text
string
【必须】统计数据按钮文字
map
object
【必须】地图相关配置
map.title
string
【必须】地图标题
map.StrengthenTitle
string
【必须】地图大标题
map.background
url
【必须】地图亮色模式背景
map.backgroundDark
url
【必须】地图暗色模式背景
selfInfo
object
【必须】作者相关信息配置
selfInfo.selfInfoTips1
string
【必须】作者相关提示文字 1
selfInfo.selfInfoContentYear
number
【必须】作者生日年份
selfInfo.selfInfoTips2
string
【必须】作者相关提示文字 2
selfInfo.selfInfoContent2
string
【必须】作者相关内容 2
selfInfo.selfInfoTips3
string
【必须】作者相关提示文字 3
selfInfo.selfInfoContent3
string
【必须】作者相关内容 3
personalities
object
【必须】作者性格相关配置
personalities.author_name
string
【必须】作者性格名称
personalities.personality_type
string
【必须】作者性格类型
personalities.photo_url
url
【必须】作者自拍图片
personalities.personality_img
url
【必须】作者性格表述图片
personalities.name_url
url
【必须】点击性格跳转到链接
maxim
object
【必须】座右铭相关配置
maxim.maxim_tips
string
【必须】座右铭相关提示文字
maxim.maxim_top
string
【必须】座右铭相关顶部文字
maxim.maxim_bottom
string
【必须】座右铭相关底部文字
buff
object
【必须】特长相关配置
buff.buff_tips
string
【必须】特长相关提示文字
buff.buff_top
string
【必须】特长相关顶部文字
buff.buff_bottom
string
【必须】特长相关底部文字
game
object
【必须】爱好游戏相关配置
game.game_tips
string
【必须】爱好游戏提示文字
game.game_title
string
【必须】爱好游戏标题
game.game_uid
string
【必须】爱好游戏 uid
game.game_bg url 【必须】爱好游戏背景
comic object 【必须】追番相关配置,需要 5 条数据
comic.comic_tips string 【必须】追番相关提示文字
comic.comic_title string 【必须】追番相关标题
comic.comic_list list 【必须】追番相关列表
comic.comic_list.name string 【必须】追番 item 名称
comic.comic_list.href url 【必须】追番 item 链接
comic.comic_list.cover url 【必须】追番 item 的 cover
like object 【必须】关注偏好相关配置
like.like_tips string 【必须】关注偏好配置提示文字
like.like_title string 【必须】关注偏好配置标题
like.like_bg url 【必须】关注偏好配置背景
like.like_bottom string 【必须】关注偏好配置底部文字
music object 【必须】音乐偏好相关配置
music.music_tips string 【必须】音乐偏好提示性文字
music.music_title string 【必须】音乐偏好标题
music.music_bg url 【必须】音乐偏好背景
music.music_link url 【必须】音乐偏好按钮链接
reward_list object 【可选】打赏相关配置,如果不配置将没有打赏模块
reward_list.name string 【必须】打赏 item 名称
reward_list.amount number 【必须】打赏 item 金额
reward_list.datatime Date 【必须】打赏 item 时间
reward_list.suffix string/元 【可选】打赏 item 后缀(默认元)
博客根目录/source/categories/index.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 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 --- title: 分类 date: 2023-06-10 23:37:08 aside: false top_img: false --- <style > #libCategories .card-wrap:hover .card-info:after { width: 300%; } </style > <link rel ="stylesheet" type ="text/css" href ="https://npm.elemecdn.com/js-heo@1.0.11/3dCard/no3d.css" > <div id ='libCategories' > <div id ="lib-cards" class ="container" > <a href ='javascript:void(0);' onClick ='pjax.loadUrl("/categories/樂去麈染/")' > <card data-image ="https://img02.anheyu.com/adminuploads/1/2022/09/05/6315e144528fb.webp" > <h1 slot ="header" > 樂去麈染</h > <p slot ="content" > 樂瑾之间的故事</p > </card > </a > <a href ='javascript:void(0);' onClick ='pjax.loadUrl("/categories/大学生涯/")' > <card data-image ="https://img02.anheyu.com/adminuploads/1/2022/09/05/6315e1433f197.webp" > <h1 slot ="header" > 大学生活</h1 > <p slot ="content" > 在大学期间发生的一些事儿。</p > </card > </a > <a href ='javascript:void(0);' onClick ='pjax.loadUrl("/categories/生活日常/")' > <card data-image ="https://img02.anheyu.com/adminuploads/1/2022/09/05/6315e142a69a9.webp" > <h1 slot ="header" > 生活</h1 > <p slot ="content" > 和好朋友👬们一起经历的有趣事。</p > </card > </a > </div > </div > <script src ='https://lf6-cdn-tos.bytecdntp.com/cdn/expire-1-M/vue/2.6.14/vue.min.js' data-pjax > </script > <script type ="text/javascript" src ="https://npm.elemecdn.com/anzhiyu-theme-static@1.0.7/no3d/no3d.js" data-pjax > </script >
博客根目录/source/link/index.md 1 2 3 4 5 --- title: link date: 2023-06-10 23:54:58 type: "link" ---
博客根目录/source/_data/link.yml 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 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 - class_name: 友情链接 class_ desc: 那些人,那些事 flink_style: flexcard link_ list: - name: Hexo link: https://hexo.io/zh-tw/ avatar: https://d33wubrfki0l68.cloudfront.net/6657ba50e702d84afb32fe846bed54fba1a77add/827ae/logo.svg descr: 快速、简单且强大的网站框架 - name: Akilarの糖果屋 link: https://akilar.top/ avatar: https://akilar.top/img/siteicon/favicon.png descr: 期待您的光临! - name: 小冰博客 link: https://zfe.space avatar: https://zfe.space/images/headimage.png descr: 做个有梦想的人! - name: Heo link: https://blog.zhheo.com/ avatar: https://img.zhheo.com/i/2022/08/19/62ff32fa28da1.png descr: 荆棘之路,劈风斩浪。 - name: 瑾谦の博客 link: https://lele08796.github.io avatar: https://z3.ax1x.com/2021/11/08/IJCf4U.jpg descr: 路为纸,地成册,行做笔,心当墨。 - name: anzhiyu主题 link: https://blog.anheyu.com/ avatar: https://img02.anzhiy.cn/adminuploads/1/2022/09/15/63232b7d91d22.jpg descr: 生活明朗,万物可爱 siteshot: https://npm.elemecdn.com/anzhiyu-blog@1.1.6/img/post/common/anzhiy.cn.jpg - name: 爱吃肉的猫 link: https://meuicat.com/ avatar: https://s1.ax1x.com/2023/05/26/p9qChjI.jpg descr: 有肉有猫有生活. - name: Rootlex link: https://blog.nalex.top avatar: https://bu.dusays.com/2023/01/25/63d130a6ce9ea.jpg descr: 寒蝉黎明之时,便是重生之日 - name: 轻笑Chuckle link: https://www.qcqx.cn avatar: https://www.qcqx.cn/img/head.webp descr: 漫天倾尘,风中轻笑 siteshot: https://www.qcqx.cn/img/chuckle.webp - name: Ariasakaの小窝 link: https://yisous.xyz avatar: https://bu.dusays.com/2022/12/15/639a9ebbbc1ad.jpg descr: 人有悲欢离合 月有阴晴圆缺 siteshot: https://vercel.yisous.xyz/img/siteshot.png - name: Adil link: https://blog.adil.com.cn avatar: https://tucdn.wpon.cn/2023/04/06/15dbbb2004b44.jpg descr: BW/HANA顾问,BI工程师,数据分析师,数据科学家。 top_img: https://tucdn.wpon.cn/2023/04/06/126fba2e88c54.png - name: Shine link: https://blog.shineyu.cn/ avatar: https://blog.shineyu.cn/img/shineyu_avatar.webp descr: 热爱生活点滴,分享时刻精彩。 siteshot: https://blog.shineyu.cn/img/website.webp - name: 葱苓 link: https://blog.itciraos.cn avatar: https://cdn.jsdelivr.net/gh/ciraos/ciraos-static@main/img/avatar1.webp descr: Dare && Do siteshot: https://cdn.jsdelivr.net/gh/ciraos/ciraos-static@main/img/site-shot.webp - name: 风记星辰 link: https://www.thyuu.com avatar: https://std.thyuu.com/logo.webp descr: 热爱你来过的每一份温度 - name: 一蓑烟雨 link: https://easyf12.top/ avatar: https://img.easyf12.top/images/2022/10/15/634a8b4186889.webp descr: 竹杖芒鞋轻胜马,谁怕?一蓑烟雨任平生。 siteshot: https://img.easyf12.top/images/2022/12/19/639fcb39327a2.png - name: 豆豆 / Amos link: https://amoshk.top avatar: https://amoshk.top/img/avatar.png descr: 终身学习的👦,记录一些生活片段 - name: ichika link: https://ichika.cc avatar: https://cdn.ichika.cc/page/HeadIcon.jpg descr: Hello,gamer! - class_name: 网站 class_ desc: 值得推荐的网站 flink_style: flexcard link_ list: - name: Youtube link: https://www.youtube.com/ avatar: https://i.loli.net/2020/05/14/9ZkGg8v3azHJfM1.png descr: 视频网站 - name: Weibo link: https://www.weibo.com/ avatar: https://i.loli.net/2020/05/14/TLJBum386vcnI1P.png descr: 中国最大社交分享平台 - name: Twitter link: https://twitter.com/ avatar: https://i.loli.net/2020/05/14/5VyHPQqR6LWF39a.png descr: 社交分享平台
参数
解释
class_name
【必填】友链分类名
class_desc
【可选】友链分类描述
flink_style
【必填】flexcard或者anzhiyu或者telescopic
hundredSuffix
【可选】解决共同进步板块头像质量问题,配置后共同进步板块的头像会添加该后缀(请确保你的图片加上 hundredSuffix 的配置后依然可以访问)。 例如:hundredSuffix: “!w120”
link_list
【必须】友链列表
link_list.name
【必须】友链名称
link_list.link
【必须】友链链接
link_list.avatar
【必须】友链头像
link_list.descr
【必须】友链描述
link_list.siteshot
【可选】flink_style 为 flexcard 或 telescopic 时友链的站点图片
link_list.recommend
【可选】快捷选项,等于color:”” + tag: “荐”
link_list.tag
【可选】左上角的 tag,为当前友链打上标签 例如:”推荐”
link_list.color
【可选】tag 的十六进制背景颜色例如: “#646cff”,提供了两个快捷颜色选项分别是vip和speed
与数百博主共同进步 1 2 3 4 5 6 linkPageTop: enable: true title: 与数百名博主无限进步 addFriendPlaceholder: "昵称(请勿包含博客等字样):\n网站地址(要求博客地址,请勿提交个人主页):\n头像图片url(请提供尽可能清晰的图片,我会上传到我自己的图床):\n描述:\n站点截图(可选):\n"
建议超过 30 以上的友链数开启,友链数目不够会导致头像无法铺满。
博客根目录/source/essay/index.md 1 2 3 4 5 6 7 8 --- title: 即刻短文 date: 2023-06-10 23:40:41 comment: true aside: false top_img: false type: essay ---
博客根目录/source/_data/essay.yml 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 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 - title: 即刻短文 subTitle: 我的日常生活。 tips: 随时随地,分享生活 buttonText: 关于我 buttonLink: /about/ limit: 30 home_essay: true top_background: https://s2.loli.net/2023/06/26/en5TZRGXMq3zWKl.png essay_list: - content: 入坑原神😃😃 date: 2023 /09/23 from: 米哈游 address: 提瓦特大陆 - content: 踏入新校园了 date: 2023 /08/28 08 :49:38 address: 西宁 - content: 科目二一把过(100分)😁😁 date: 2023 /08/24 11 :15:27 address: 海东驾考中心 - content: 晏德强(未来的晏警官)邀请好友聚餐 date: 2023 /08/23 20 :56:48 address: 囍辰酒店 - content: 考科目二了,去看考场 date: 2023 /08/20 07 :14:13 address: 海东驾考中心 - content: 难受╯﹏╰,不想说话 date: 2023 /08/03 19 :16:13 - content: 科目一(95分)😁😁 date: 2023 /07/21 11 :54:25 address: 海东驾考中心 - content: 练科目一 date: 2023 /07/04 14 :54:46 address: 乐都 - content: 等待我的只是灭亡?不,而是死亡和痛苦 date: 2023 /07/04 14 :41:39 - content: 科目一(89分)——挂了😭 date: 2023 /06/30 14 :56:23 address: 海东驾考中心 - content: 出高考成绩了,心累😪 date: 2023 /06/25 10 :14:45 - content: 一个字:烦òᆺó date: 2023 /06/24 09 :08:00 - content: 粽叶飘香五月五,浓情端午共安康 date: 2023 /06/22 - content: 学车之旅-三点头启动,一点头定车😂 date: 2023 /06/16 07 :17:09 - content: 歌曲推荐 date: 2022 /06/16 00 :00:00 aplayer: server: tencent id: 00071h8e2AY4Tm - content: 遇见彩虹🌈吃定彩虹 date: 2022 /10/23 10 :00:00 image: - https://bu.dusays.com/2023/04/09/64329399e285d.webp - https://bu.dusays.com/2023/04/09/64329399aa3bc.webp - https://bu.dusays.com/2023/04/09/6432939996dd7.webp - content: 妹妹强制要求我买走了她的两幅画 -¥30 date: 2022 /10/02 image: - https://bu.dusays.com/2023/04/09/643293997b92b.jpeg
【主题版本1.6.7以上支持】其中video对于bilibili进行的额外的支持,视频为player.bilibili.com的将显示为bilibili视频,并且可以在链接后面拼接&autoplay=0控制不自动播放
留言板配置 在博客根目录下
1 npm install hexo-butterfly-envelope --save
在站点配置文件_config.yml中添加以下内容配置,更多配置请查看信笺样式留言板
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 envelope_comment: enable : true custom_pic: cover: https://npm.elemecdn.com/hexo-butterfly-envelope/lib/violet.jpg line: https://npm.elemecdn.com/hexo-butterfly-envelope/lib/line.png beforeimg: https://npm.elemecdn.com/hexo-butterfly-envelope/lib/before.png afterimg: https://npm.elemecdn.com/hexo-butterfly-envelope/lib/after.png message: - 有什么想问的? - 有什么想说的? - 有什么想吐槽的? - 哪怕是有什么想吃的,都可以告诉我哦~ bottom: 自动书记人偶竭诚为您服务! height: path: front_matter: title: 留言板 comments: true top_img: false type : envelope
博客根目录/source/equipment/index.md 1 2 3 4 5 6 --- title: 我的装备 date: 2023-07-05 10:25:32 aside: false type: equipment ---
博客根目录/source_data\equipment.yml 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 34 35 36 - class_name: 好物 description: 实物装备推荐 tip: 跟 樂乐 一起享受科技带来的乐趣 top_background: https://s2.loli.net/2023/06/26/f2knxLCUB9yFQXr.png good_things: - title: 生产力 description: 提升自己生产效率的硬件设备 equipment_list: - name: HUAWEI MateBook D 14 2021 14.2 英寸(云杉绿) specification: i9-13900H;英特尔®锐炬® Xᵉ 显卡 32G / 512 GB NVMe PCIe SSD description: 缤纷视界,沉浸,真实。更强性能,助力创作办公。超级终端,带来智慧办公方式。 image: https://consumer.huawei.com/content/dam/huawei-cbg-site/cn/mkt/pdp/laptops/matebook-14s-2023/resource/imagesnew/mob/huawei-matebook-14s-Spruce-green-img-mob@2x.webp link: https://consumer.huawei.com/cn/laptops/matebook-14s-2023/ - name: HUAWEI MatePad Pro 11 英寸 specification: 星河蓝 / 256G description: 是平板,也是电脑。HarmonyOS 3 真的厉害👍🏻 image: https://consumer.huawei.com/content/dam/huawei-cbg-site/cn/mkt/pdp/tablets/matepad-pro-11/img/module6/huawei-matepad-pro-11-tablet-look-m.webp link: https://consumer.huawei.com/cn/tablets/matepad-pro-11/ - name: vivo S15 specification: 浅金(金色灵动,淡浓相宜) / 256G description: 一体式航空铝中框,航空级标准材料,轻盈又坚固;拥有 66W双电荷泵设计,充电效率翻倍。配合 4500mAh大电池,成就 S 系列迄今最好的续航表现。更有 24 重充电安全守护,发热更少,迅速又安心。 image: https://wwwstatic.vivo.com.cn/vivoportal/files/image/detail/20220513/d7f5ce81b6494566acb9ac042d242201.png link: https://www.vivo.com.cn/vivo/s15/ - name: 漫步者 W3 DSP Pro specification: DSP薛之谦联名版 description: 音乐态度 始终如一 image: https://cn-oss.edifier.com/Uploads/images/2021/05/05/2021050523200916202280091656539.jpg link: https://www.edifier.com/cn/product/product-16.html - title: 出行 description: 用来出行的实物及设备 equipment_list: - name: 小米手环7 specification: 黑色 description: 始终为我的健康放哨,久坐弹出站立提醒,不过确实有效的提高了我的运动频率。腕上新风景,新鲜感不断;手腕上的「运动分析专家」,专业数据,解答运动日常提问。 image: https://cdn.cnbj0.fds.api.mi-img.com/b2c-shopapi-pms/pms_1653393475.27699056.png link: https://www.mi.com/shouhuan7
追番页面配置 在博客根目录下
1 npm install hexo-bilibili-bangumi --save
在 hexo 配置文件_config.yml中加入以下配置,注意不是主题配置文件
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 bangumi: enable : true source : bili path: vmid: 341232484 title: "追番列表" quote: "生命不息,追番不止!" show: 1 lazyload: false loading: showMyComment: false pagination: false metaColor: color: webp: progress: extraOrder: proxy: host: "代理host" port: "代理端口" extra_options: top_img: false lazyload: enable : false
在hexo generate 或hexo deploy 之前使用
命令更新追番数据
追剧页面配置 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 cinema: enable : true path: vmid: 341232484 title: '追剧列表' quote: '生命不息,追剧不止!' show: 1 lazyload: true srcValue: '__image__' lazyloadAttrName: 'data-src=__image__' loading: metaColor: color: webp: progress: extraOrder: order: extra_options: key: value
在hexo generate 或hexo deploy 之前使用
命令更新追番数据
博客根目录/source/album/index.md 1 2 3 4 5 6 7 --- title: 相册集 date: 2023-06-11 00:08:10 aside: false top_img: false type: "album" ---
博客根目录/\source_data\album.yml 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 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 - class_name: 世界各地夕阳与风景 path_name: /wordScenery type: 2 description: 因为到不了世界各地,所以请网友们发来了各地的夕阳与风景🌇。 cover: https://bu.dusays.com/2023/04/09/64329399d1175.jpg rowHeight: 220 limit: 10 lazyload: true btnLazyload: false url: false album_list: - date: 2022 /10/26 01 :00:00 content: 湘潭的一角。 address: 湖南湘潭 from: 再吃一口就减肥 image: - https://bu.dusays.com/2023/04/09/64329399db122.webp - date: 2022-10-25 content: 洛阳暴雨后的天空。 address: 河南洛阳 from: 紫菜卷 image: - https://bu.dusays.com/2023/04/09/64329399db122.webp - https://bu.dusays.com/2023/04/09/64329399db2e1.webp - class_name: 壁纸 path_name: /BlogWallpaper type: 1 description: 这里存放的是有关我自己收藏的一些好看的壁纸。 cover: https://s2.loli.net/2023/06/26/3rP6MoJsianfXLI.png album_list: - date: 2022-04-05 content: 清明时节 image: - https://s2.loli.net/2023/06/26/vwjorxuMakIHOgd.jpg - date: 2022-04-05 content: 铺の作 image: - https://s2.loli.net/2023/06/26/G4I1faPTSqZmYeW.jpg - date: 2022-04-05 content: 风景 image: - https://s2.loli.net/2023/06/26/fFanQqhtogC9NJL.png - date: 2022-04-05 content: 埃菲尔铁塔 image: - https://s2.loli.net/2023/06/26/xRfLrtETbK7DqkP.png - date: 2022-04-05 content: の image: - https://s2.loli.net/2023/06/26/MuZ6KfJcmrUvC5V.png - date: 2022-04-05 content: 你的名字 image: - https://s2.loli.net/2023/06/26/Qb2gFTr83ZBJGit.png - date: 2022-04-05 content: 清明时节 image: - https://s2.loli.net/2023/06/26/gZ3RKe9jXTknENQ.jpg - date: 2022-04-05 content: 天气之子 image: - https://s2.loli.net/2023/06/26/MscFxENBPwfzyuY.png - date: 2022-04-05 content: 风景 image: - https://s2.loli.net/2023/06/26/tFjVpUEark6YJKd.png - date: 2022-04-05 content: 我可以一直爱你,你可以一遍遍确认。 image: - https://s2.loli.net/2023/06/26/zj1xVvCao7QDske.png - date: 2022-04-05 content: 雪景 image: - https://s2.loli.net/2023/06/26/7FGQtOW1Shropcs.png - date: 2022-04-05 content: 抗疫英雄 image: - https://s2.loli.net/2023/06/26/ja5rBS87kRpTNdo.jpg - class_name: 我的日常 path_name: /dailyPhoto type: 1 description: 这里存放的是有关我自己的一些沙雕生活与有趣的事情。 cover: https://bu.dusays.com/2023/04/09/64329399cea5a.webp album_list: - date: 2022-10-24 content: 老妹的画 image: - https://bu.dusays.com/2023/04/09/643293997b92b.jpeg
参数
备选值/类型
解释
class_name
string
【必须】页面类
path_name
url
【必须】当前相册路径
type
number
【必须】当前相册页面样式类型
description
string
【必须】当前相册描述
cover
url
【必须】当前相册 cover 图片
rowHeight
number
【可选】仅当 type 为 2 时有效,当前相册 rowHeight
limit
number
【可选】仅当 type 为 2 时有效,当前相册 一次懒加载的数量
lazyload
boolean
【可选】仅当 type 为 2 时有效,当前相册 lazyload 是否开启懒加载,默认懒加载为滚动懒加载,type 为 1 时懒加载不可关闭。
btnLazyload
boolean
【可选】仅当 type 为 2 且 lazyload 开启 时有效,当前相册 lazyload 懒加载的方式,默认为滚动懒加载,开启本选项后为按钮点击懒加载。
album_list
list
【必须】当前相册内图片列表
url
url
【可选】仅当 type 为 2 时有效,可以加载远程的 json 数据。
album_list.date
date
【必须】当前图片创建时间
album_list.content
string
【必须】当前图片描述内容
album_list.image
list
【必须】当前图片集,可以多张
album_list.from
string
【可选】当前图片的创建人,未填写则不显示
album_list.address
string
【必须】当前图片地址
由于相册页面需要很多的 page,所以在写数据的时候自行写入路径path_name,示例数据中有两个path_name,所以需要再创建两个页面
1 2 hexo new page dailyPhoto hexo new page wordScenery
你会找到 source/dailyPhoto/index.md 和source/wordScenery/index.md两个文件,这两个为相册集详情页
然后内容为以下内容, 需在详情页加上type: “album_detail”
1 2 3 4 5 6 7 --- title: 世界各地风景 date: 2022-10-23 15:57:51 aside: false top_img: false type: "album_ detail"---
博客根目录/source/music/index.md 1 2 3 4 5 6 7 8 9 --- title: 音乐馆 date: 2023-06-11 00:20:47 type: "music" aplayer: true top_img: false comments: false aside: false ---
hexo 配置文件_config.yml中添加以下配置,注意不是主题配置文件
1 2 3 4 5 aplayer: meting: true asset_inject: false
如何修改默认歌单? 将menu中音乐馆的路径修改为以下格式即可/music/?id=1708664797&server=tencent,支持id和server参数。
博客根目录/source/air-conditioner/index.md 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 --- title: 便携小空调 - 为你的夏日带去清凉! date: 2022-10-20 22:06:17 comments: true aside: false top_img: false --- > 终于为博客安装上了便携小空调 <style > .copyright-box a { border-bottom: none !important; padding: 0 !important; } </style > <div id ="air-conditioner-vue" > </div > <script defer data-pjax src ='https://npm.elemecdn.com/anzhiyu-air-conditioner@1.0.1/index.3f125bc6.js' > </script >
然后访问https://你的博客域名/air-conditioner 就可以得到一个没有风的空调
最后的页面配置 主题配置文件中开启menu中我的、关于和友链的注释,注意缩进!!!
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 menu: 文章: 隧道: /archives/ || anzhiyu-icon-box-archive 分类: /categories/ || anzhiyu-icon-shapes 标签: /tags/ || anzhiyu-icon-tags 友链: 友人帐: /link/ || anzhiyu-icon-link 留言板: /comments/ || anzhiyu-icon-envelope 我的: 音乐馆: /music/?id=8335997312&server=tencent || anzhiyu-icon-music 追番页: /bangumis/ || anzhiyu-icon-bilibili 追剧页: /cinemas/ || anzhiyu-icon-bilibili 相册集: /album/ || anzhiyu-icon-images 小空调: /air-conditioner/ || anzhiyu-icon-fan 关于: 关于本人: /about/ || anzhiyu-icon-paper-plane 闲言碎语: /essay/ || anzhiyu-icon-lightbulb 我的装备: /equipment/ || anzhiyu-icon-dice-d20
6.字数统计 在博客根目录下
1 2 3 npm install hexo-wordcount --save 或者 yarn add hexo-wordcount
修改 主题配置文件:
1 2 3 4 5 wordcount: enable: true post_wordcount: true min2read: true total_wordcount: true