What is Hugo?

Hugo is a static site generator by written in Go. I was looking for any generator to publish something nowadays. I have been using WordPress for a personal blog before. But that looks boring to me anymore. I came across Hugo framework. I loved it. I highly would like to suggest you to use that framework. There are also a lot of alternatives. You can find them by surfing. I just installed Hugo to my local and published via GitHub Pages. I would like to start posting this installation and deployment steps that I just followed.

How to install Hugo?

Hugo Framework has a well-documented website. I did use Homebrew to install it. You can start quickly by following this page

How to host your Hugo site on GitHub?

  • You create a GitHub repository that called <github-username>.github.io
  • You create a new hugo site on your local environment.
1
hugo new site my-awesome-blog
  • You should choose a theme from official list.
  • You must go to your hugo site directory like my-awesome-blog and clone your choice.
1
cd my-awesome-blog && git clone <theme-name-github-repository> themes/theme-name
  • After you update your config.toml for your new theme and website configuration, you run the following command when you inside the blog directory and you should see first look about your awesome blog.
1
hugo server

Go to http://localhost:1313/ to see everything.

  • Next steps are about to deploy/publish your awesome blog. You remove public directory and add your repository as public.
1
git clone github-username/<github-username>.github.io public
  • You can create something (post or static page) via hugo CLI now. After that, you run hugo -t <your-theme-name>. This command creates rendered files to publish into public directory. This means your repository needs to commit and push. You should go to public directory by running cd public and send your last changes to remote repository you created before.
1
git add . && git commit -m "Your commit message" && git push origin master
  • Finally! You can go to your awesome blog by typing <github-username>.github.io.