Setting Up Blog With Github Pages and Hugo #
Hugo is a static site generator that lets us create sites very fast.
-
Install hugo from installation page of hugo. Follow appropriate steps need to instal it.
We also need git to be installed. Make sure git is setup in the system.
-
Generating new site with hugo
hugo new site <site_name>
Example:
hugo new site sample-site
cd sample-site
- Adding theme. We can add any theme we want. Themes can be found here. Here I’ll be adding Book theme.
git submodule add https://github.com/alex-shpak/hugo-book.git themes/hugo-book
- Update config file
Now we have to let the config.toml
file know which theme we will be using.
At the end of the file add
theme = 'hugo-book'
- Start the server
hugo server
- Adding content
We can’t just add contents directly by creating files. We’ll have to use hugo command for this.
hugo new posts/first-book.md
- Bundeling
hugo -t <theme_name>
Example:
hugo -t hugo-book