因为近期安利一些同事购买腾讯云低价服务器,承诺了人手送一个能够自动更新的我的博客,顺便优化了一下本站的部署代码.html
在 github 上 fork 如下 2 个库:git
修改 hexo_template 仓库中 ./_config.yml
文件如下内容:github
# Site
title: 标题
subtitle: 副标题
avatar: 头像连接URL
description: 我的简介
author: 做者名称
# URL
url: 博客主页URL
复制代码
查看修改 hexo_template 仓库中 ./themes/next/_config.yml
文件内容:docker
安装 Gitshell
apt-get update
apt-get install git
复制代码
拉取部署脚本仓库ubuntu
cd ~/
git clone https://github.com/linhay/build.git
复制代码
安装docker环境浏览器
cd ~/build/shells/
sh install-docker.sh
复制代码
修改Dockerfile文件安全
vi ~/build/dockerfiles/hexo/hexo/Dockerfile
# 将如下2行内容修改成准备步骤的仓库
# RUN git clone https://github.com/linhay/hexo_template
# RUN git clone https://github.com/linhay/hexo_pages_template source
复制代码
拉起服务bash
cd ~/build/dockerfiles/hexo/
sh start.sh
复制代码
放开9000端口服务器
访问博客
将新的文章上传至 hexo_pages_template 仓库 _post
目录下
等5s再访问博客便可
有一个 5s 定时拉取的脚本在 docker 中.
修改 hexo_template 仓库内容
重启服务
cd ~/build/dockerfiles/hexo/
sh start.sh
复制代码
该部份内容不展开了,云主机厂商都有完整的购买与说明了.
临近年关,琐事繁多,献水文一篇.
若是有其余想法不妨在Github联系我.