Hexo Template Test

中文 | English
Hexo logo

Hexo Template

一个快速、简洁且高效基于 Node.js的博客框架。 这是它的模板。



快速开始

_config.yml 的16行设置你的站点地址

例如,如果你使用Github Pages默认地址,可以设置为: https://username.github.io/projectname:

1
url: https://lopins.github.io/hexo-template

_config.yml 的107行设置你的项目ID

如果你的项目ID为 username or username.github.io, 你只需要在 _config.yml的最后一行设置:

1
root: /hexo-template

配置主题

  1. 拉取主题并进入 themes/ 并更新相关信息

git submodule add git@github.com:litten/hexo-theme-yilia.git themes/yilia && git submodule update --init --recursive

  1. _config.yml 中更新 theme: yilia 并且配置其他信息

  2. _config.yilia.yml 或者进入 themes/yilia_config.yml 文件配置主题相关

应用配置

git add . && git commit -m ':wrench:docs(themes): Add or update configuration files' && git push origin main

发布文章

  1. 启用站点

点击 “Use this template” -> “Create a new repository”

Use this template to create a new repository

  1. 配置站点

设置并且启用 GitHub Pages 服务

Set up and enable GitHub Pages service

  1. 发布文章

发布文章在 hexo 分支。

Publish an article on the "hexo branch" of Github.

特别注意

使用 Submodule 切换主题

1
2
3
4
5
6
7
8
9
10
11
12
13
# Add Submodule - Upadte Submodule
git submodule add git@github.com:litten/hexo-theme-yilia.git themes/yilia
git submodule update --init --recursive

# Delete Submodule
git submodule deinit -f themes/yilia
rm -rf .git/modules/themes/yilia
rm -rf themes/yilia

# Display Submodule - Pull Submodule - Sync Submodule
git submodule status
git submodule foreach git pull origin main
git submodule sync

权限问题

如果你遇到类似 remote: Permission to xxx denied to github-actions[bot].

当你推送更改时,你需要设置仓库的 github-actions[bot] 权限.

设置步骤: Settings -> Actions -> General -> Workflow permissions -> Read and write permissions -> Save.

开源协议

MIT License.