Skip to content
/ hexo-template Public template

Template of Hexo, with CI/CD by GitHub Actions.

License

Notifications You must be signed in to change notification settings

lopins/hexo-template

Repository files navigation

中文 | English

Hexo logo

Hexo Template

A fast, simple & powerful blog framework, powered by Node.js. Here is the template of it.



Get Started

Set your site url at line 16

For example, if you use GitHub Page, set url as https://username.github.io/projectname:

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

Set your project name at line 107

if your project name is username or username.github.io, just remove it at the end of _config.yml:

root: /hexo-template
  1. pull theme into themes/ and update it(Choose one of the following.).

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

    git clone git@github.com:litten/hexo-theme-yilia.git themes/yilia && rm -rf themes/yilia/.git

  2. update theme: yilia and configure other fields in _config.yml

  3. configure the theme in _config.yilia.yml or into themes/yilia to configure the theme in _config.yml

  4. (Optional) If the theme has dependent plugins, you also need to run npm install && npm install hexo-xxx hexo-yyy hexo-zzz --save

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

  1. Install

    Click "Use this template" -> "Create a new repository"

1. Create a new repository

  1. Set up

    Set up and enable GitHub Pages service

2. Set up GitHub Pages branch

  1. Publish

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

3. Write or Upload an Markdown file

Notice

Submodule to Change Theme

# 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
git config --remove-section submodule.themes/yilia
git config -f .gitmodules --remove-section submodule.themes/yilia
git rm --cached themes/yilia
git add . && git commit -m 'Update .gitmodules before removing submodule'

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

Permission

If you meet the problem like remote: Permission to xxx denied to github-actions[bot].

When you push your changes, you need to give the permission to the github-actions[bot] in your repo's.

By following the steps below: Settings -> Actions -> General -> Workflow permissions -> Read and write permissions -> Save.

License

MIT License.