Hexo安装与主题配置使用教程
简单使用Hexo安装与主题配置使用教程
Hexo安装与主题配置使用教程
一、Hexo安装
1. 安装Hexo命令行工具
1 | npm install hexo-cli -g |
2.初始化Hexo站点
1 | hexo init blog |
进入站点目录:
1 | cd blog |
3.启动本地服务器
1 | hexo server |
访问http://localhost:4000即可查看博客。
二、主题安装与配置
1.安装主题
1 | git clone https://github.com/tufu9441/maupassant-hexo.git themes/maupassant |
2.配置主题
全局配置文件_config.yml
1 | theme: maupassant |
主题配置文件_config.yml
在主题目录themes/maupassant/_config.yml中,进行详细配置:
1 | disqus: |
三、生成与部署
1.生成静态文件
1 | hexo generate |
2.部署到远程服务器
安装部署插件(以部署到GitHub Pages为例)
1 | npm install hexo-deployer-git --save |
在_config.yml文件中配置部署信息
1 | deploy: |
运行以下命令进行部署
1 | hexo deploy |
通过以上步骤,你就可以成功安装并配置Hexo及其主题,创建并部署自己的个人博客了。