Skip to content

lopins/hugo-template

Repository files navigation

中文 | English

Hugo logo

Hugo Template

A fast and flexible static site generator built with love by bep, spf13, and friends in Go.



Get Started

Define Domain

Change the baseURL in config.yml or config.toml to your site's URL

baseURL: "https://lopins.github.io/hugo-template"
  1. pull theme into themes/ and update it.

    git submodule add git@github.com:zhaohuabing/hugo-theme-cleanwhite.git themes/cleanwhite && git submodule update --init --recursive

    cp -r exampleSite/* ../

  2. In config.yml or config.toml, change the value of the theme property to "cleanwhite"

3. update editPost: "https://github.com/lopins/hugo-template/tree/main/content" in config.yml or config.toml

Push to Github

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

  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 "hugo 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:zhaohuabing/hugo-theme-cleanwhite.git themes/cleanwhite
git submodule update --init --recursive

# Delete Submodule
git submodule deinit -f themes/cleanwhite
rm -rf .git/modules/themes/cleanwhite
rm -rf themes/cleanwhite
git config --remove-section submodule.themes/cleanwhite
git config -f .gitmodules --remove-section submodule.themes/cleanwhite
git rm --cached themes/cleanwhite
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.