Build and Deploy Hexo-based github pages

Welcome to Hexo! This is your very first post. Check documentation for more info. If you get any problems when using Hexo, you can find the answer in troubleshooting or you can ask me on GitHub.

官方文档(自动生成) Quick Start

Create a new post

hexo new "My New Post"

More info: Writing

Run server

hexo server

More info: Server

Generate static files

hexo generate

More info: Generating

Deploy to remote sites

hexo deploy

More info: Deployment

个人实践

Create a new post

hexo new "YuanBlog"

下载theme主题

hexo 主题

本主题下载地址:hexo-theme-snark

配置主题

  1. 将主题文件复制到themes目录下
  2. 修改_config.yml文件:找到theme字段,将值改为主题文件名
  3. 按照具体主题的具体要求修改_config.yml,npm下载相应的主题依赖包

Run server

hexo server

More info: Server

Generate static files

hexo generate

部署到github pages

  1. 创建一个github pages仓库
  2. 修改_config.yml文件:
deploy:
type: git
repo: https://github.com/NEU-Apollo/NEU-Apollo.github.io.git
branch: main
  1. npm下载git部署所需的依赖
npm install hexo-deployer-git --save

Deploy to remote sites

hexo deploy

More info: Deployment