配置hexo
配置hexo
软件 | 版本 |
---|---|
nodejs | 16.20.0 |
nginx | 1.24.0 |
节点 | IP | 系统 | 功能 | CPU | 内存 | 硬盘 |
---|---|---|---|---|---|---|
node1 | 10.80.10.1 | centos7.9 | hexo | 4核心 | 8GB | 20GB |
node1
hexo目录:
1 | # tree -L 1 /data/hexo/ |
下载安装主题:
1 | # cd /data/hexo/themes/ |
选择主题:
1 | # vim /data/hexo/_config.yml |
配置网站基本信息:
1 | # vim /data/hexo/_config.yml |
配置主题样式:
1 | # vim /data/hexo/themes/hexo-theme-next/_config.yml |
1 | # pm2 restart /data/hexo/run.js |
浏览器访问:http://10.80.10.1/
设置菜单,默认有首页,其它需要创建目录:
1 | # vim /data/hexo/themes/hexo-theme-next/_config.yml |
1 | # hexo new page "tags" |
设置图片放大:
1 | # vim /data/hexo/themes/hexo-theme-next/_config.yml |
指定头像:
1 | # vim /data/hexo/themes/hexo-theme-next/_config.yml |
- 头像位置:/data/hexo/source/。
修改标签和分类页面显示为中文:
1 | # vim /data/hexo/source/tags/index.md |
1 | # vim /data/hexo/source/categories/index.md |
添加文章版权:
1 | # vim /data/hexo/themes/hexo-theme-next/_config.yml |
新建博客及图片显示:
1 | # hexo new "xxx" |
博客位置:/data/hexo/source/_posts/xxx.md。
图片文件夹对应存放位置:/data/hexo/source/。
图片需要使用![]()格式插入,不能使用<img src>格式插入,否则无法识别。
添加建站时间:
1 | # vim /data/hexo/themes/hexo-theme-next/_config.yml |
自定义背景:
1 | # vim /data/hexo/themes/hexo-theme-next/_config.yml |
1 | # mkdir /data/hexo/source/_data |
background:url:背景图片的地址,放置于Next主题文件下的。
- 位置:/data/hexo/themes/hexo-theme-next/source/images/
fixed:表示是否随鼠标滚动,选择fixed固定。
size:表示填充。
posi:表示位置。
关闭文章目录:
1 | # vim /data/hexo/themes/hexo-theme-next/_config.yml |
添加网站运行时间:
1 | # vim /data/hexo/themes/hexo-theme-next/layout/_partials/footer.njk |
文章置顶:
1 | # npm install hexo-generator-index-pin-top --save |
图片懒加载,加载中显示loading:
1 | # npm install hexo-lazyload-image --save |
1 | # pm2 restart /data/hexo/run.js |
关闭更新时间:
1 | # vim /data/hexo/themes/hexo-theme-next/_config.yml |