// Florian Brüssel / fBrx


...fixing the world, one exception at a time...


Getting started with Hugo

Hugo is a static CMS system. In this case static means, that all the content is rendered to static html markup. So there is no need for anything else than a HTTP server to run your site. This makes the whole thing a lot less complicated as well as a lot more secure.

The content for a site which is generated by Hugo is generally edited in markdown files. This gives you the possibility to edit everything disconnected as well as choose the tools you like for your writing

Installation

If you are running on a mac and are using homebrew (which you probably should anyway) just brew install hugo.

Create your first site

Hugo provides so called builders. Builders can be used to generate specific items like pages, blog posts and whole sites.

The site builder is invoked as follows: hugo new site /path/to/your/site

Yes…thats it. Hugo just created a minimal site structure with all files and folders needed.

Install themes

Hugo provides a set of themes which are all hosted on github. To use a theme, it has to be copied to the local site structure under the themes folder.

To install all available themes go to your working directory and clone the corresponding git repository: git clone --recursive https://github.com/spf13/hugoThemes themes.

Run your site locally

Just run hugo server -D -w -t hyde from your working directory.

  • The -Dswitch tells Hugo to generate and display pages, which are marked as drafts.
  • With -w Hugo will be monitoring the working directory for any changes and publish them immediately.
  • To select the theme which should be used to generate the site the -t <theme name> option is used.
Categories: