使用Hexo在Gitee上搭建个人博客
使用Hexo在Gitee上搭建个人博客
使用 Hexo 搭建个人博客
官网:https://hexo.io/zh-cn/docs/
安装
1 | npm install -g hexo-cli |
如果使用 npm 下载失败,推荐使用 yarn
1 | yarn global add hexo-cli |
使用 hexo-cli 一键配置
1 | npm install hexo |
熟悉 npm 可以使用 hexo 自定义配置
搭建
1 | hexo init <folder> |
使用 npm 下载
1 | npm install |
使用 yarn 下载
1 | yarn |
目录
1 | . |
_config.yml
网站的配置信息
scaffolds
模版 文件夹。当您新建文章时,Hexo 会根据 scaffold 来建立文件。
Hexo的模板是指在新建的文章文件中默认填充的内容。例如,如果您修改 scaffold/post.md 中的Front-matter内容,那么每次新建一篇文章时都会包含这个修改。
source
资源文件夹是存放用户资源的地方。除 _posts
文件夹之外,开头命名为 _
(下划线)的文件 / 文件夹和隐藏的文件将会被忽略。Markdown 和 HTML 文件会被解析并放到 public
文件夹,而其他文件会被拷贝过去。
themes
主题
本地运行测试
1 | hexo generate |
打开hexo的服务,在浏览器输入localhost:4000就可以看到你生成的博客了
Gitee 搭建服务
创建库
==库名最好与用户名相同,网址可以缩写==
开启服务
部署
修改配置文件
1 | # Site |
我为重要的配置给出了的注释,你可以根据自己的需求进行个性化配置
如果你的博客部署在二级路径上,则需要配置 root 根路径,就可以取消上面的 root 配置项的注释进行配置
1 | url: http://xxx.gitee.io/blog |
安装 hexo-deployer-git
1 | git 部署工具 |
部署
1 | 清除缓存 |
-
感谢你赐予我前进的力量
赞赏者名单
因为你们的支持让我意识到写文章的价值🙏
本文是原创文章,采用 CC BY-NC-ND 4.0 协议,完整转载请注明来自 View Room
评论