Easy Hugo Blog(EHB)is a GitHub Template repo for creating a Hugo blog rapidly just by click Use this template.
It integrates several plugins/GitHub Actions to make things easy and simple.
- gitfx shortcode plugin helps to insert code snippets and its outputs in post automaticly
- hugo-with-github-issues Action is used to create/edit new blog post in Issues and then added/updated to Hugo posts automaticly
- peaceiris/actions-gh-pages Action helps to deploy posts to
<Your username/Organization>.github.io
automaticly
- Use this template to create a repo, name it as
<Your GitHub username/Orgnization>.github.io
. - To create new posts in
content/post
folder, and commit. Generated static content will be pushed togh-pages
automaticly - Go to repo's
Settings
page, clickPages
in left menu and set Pages' branch asgh-pages
as below:
- A minute or two, your GitHub Pages site will be updated.
Use case:
A GitHub Free Plan account cannot use the GitHub Pages in a private repository. To make your source contents private and deploy it with the GitHub Pages, you can deploy your site from a private repository to a public repository.
Take your username/Organization as openpress
for example:
openpress/homepage
: A private repository ofEasy Hugo Blog
templateopenpress/openpress.github.io
: A public repository using GitHub Pages
Note: the two repos must belong to one user/organization.
And you need use deploy_key
. Firstly set your private key to the private repository, and ensure that the Name is set as ACTIONS_DEPLOY_KEY
and set your public key to your public repository.
Note: You can use ssh-keygen Template to create a deploy key
in GitHub repo instead of commandline.
Then just create posts and set the public repo's GitHub Pages' branch as gh-pages
.
Done!