Setting Up Blog With Github Pages

Setting Up Blog With Github Pages and Hugo #

Hugo is a static site generator that lets us create sites very fast.

  1. 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.

  2. Generating new site with hugo

hugo new site <site_name>

Example:

hugo new site sample-site
cd sample-site
  1. 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
  1. 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'
  1. Start the server
hugo server
  1. 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
  1. Bundeling
hugo -t <theme_name>

Example:

hugo -t hugo-book