前言

Hexo,一个快速、简洁且高效的博客框架。在各种的插件与主题之下,结合管理面板使用,可以与其获得与WordPress和typecho相媲美的优势所在。

通过示例Github仓库构建

内部版本:

主程序:Hexo:6.2.0

主题:Hexo-theme-yun:1.10.6

部署到Vercel

Deploy with Vercel

部署到Netlify

部署到Cloudflare Pages

建议通过以上两种方式构建仓库之后,再用git方式添加到pages部署

用Github Action部署

私有方式部署(指部署仓库私有)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
name: Deploy By GitHub Pages
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2 - name: Setup Node
uses: actions/setup-node@v2
with:
node-version: 16.x

- name: Install Dependencies
run: npm i
- run: npm run build

- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
personal_token: ${{ secrets.PERSONAL_TOKEN }}
external_repository: 你的Github用户名/你的Github仓库名
publish_dir: ./public
publish_branch: gh-pages
force_orphan: true

公有方式部署(指部署仓库公有)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
  name: Deploy By GitHub Pages
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: 16.x

- name: Install Dependencies
run: npm i
- run: npm run build

- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./public
publish_branch: gh-pages
force_orphan: true