DEV Community

Cover image for Hugo #1 - Intro to Static Site Generators
Thomas Sarmis
Thomas Sarmis

Posted on • Edited on • Originally published at greekdeveloper.com

Hugo #1 - Intro to Static Site Generators

A static site generator (SSG) is an application that converts simple text files (with minimal markup) to static sites using predifend templates (Themes). They provide a middle ground between fully fledged Content Managment Systems (like wordpress or drupal) and statically build sites.

Pros

  • No server-side infrastructure except a simple http server (no database, no server-side application).
  • Simple deployment procedure (just copy the generated files).
  • Every deployment is a full deployment (no differences between local and remote site)
  • Easily to track content and theme via source code versioning system
  • Content consistency (every page looks the same due to template usage)

Cons

  • The application is required in order to alter content (ie. cannot publish frpm mobile)
  • No advanced content management or authorization model
  • There is a learning curve for doing more complex tasks (but this is true for every other option)

Use case

SSGs are a fitting option for personal or small teams, blog-style sites where any commenting is either disabled or off-loaded to another tool (ie facebook comments) - If the team member are familiar with text editing, markdown and git (like developers are) even better.

Operation & Setup

The typical steps to setup an SSG are:

  1. Download SSG binaries or script
  2. Create a new folder (project)
  3. Download a theme
  4. Configure site parametes (title, url, theme, etc)
  5. Create content (simple ascii files, using markdown)
  6. Build static files
  7. Deploy static files

Which one?

There are multiple SSGs to select from, but the 3 most used are:

  • Jekyll is the most used (partailly due to being used by github pages), but setting up RoR on a windows machine could be intimidating..
  • Hugo is build in "Go" but ships as a single executable and is a nice option
  • Hexo is build in node.

My personal preference is Hugo

Origin post at greek developer

Top comments (3)

Collapse
 
sarmis profile image
Thomas Sarmis

No, not yet at least