01 Hugo
Hugo Hugo is a static site generator written in Go and claims to be fastest framework in the world. Why use hugo over alternatives like medium It’s easy to build You have control on where to deploy It’s free and secure Highly customizable Features of Hugo It’s fast Markdown (and other formats) to static HTML Themes Multilanguage support Builtin server for local development Easy to deploy Great documentation Next
02 Setup
Installation Hugo’s Installation guide can be found here . Commands for installing hugo for major operating systems are mentioned below. Linux Snap snap install hugo Ubuntu and debian snap install hugo Arch sudo pacman -Syu hugo Fedora, RHEL or CentOS sudo dnf install hugo Windows With Chocolatey choco install hugo or install binary from here MacOS With [homebrew)[https://brew.sh/] brew install hugo Prev | Next
03 Create Hugo Site
Creating the project hugo new site <HUGO_PROJECT> cd <HUGO_PROJECT> git init Adding a theme Select a theme from hugo’s theme page . git submodule add <THEME_URL> themes/<THEME_NAME> Example using Notepadium theme git submodule add https://github.com/cntrump/hugo-notepadium.git themes/hugo-notepadium Add entry the following entry to config.toml theme = "<THEME_NAME>" Most themes will provide instructions on how to setup config.toml to use various components of the theme. For Notepadium replace the contents of config.toml with the default values given in the description of the theme.…
04 Templates
Templates Some of the most used templates are:- Base Template List Template Single Template These templates are basic HTML files that has access to variables and contents from your post. These files are stored in ./layouts director. Default templates can be placed in ./layouts/_default For templates specific to a folder in ./contents say ./content/dir1, the corresponding templates should be in ./layouts/dir1 Base template is created as baseof.html. This contains outer shell of all other templates.…
05 What's next
There are a lot more to learn about Hugo. Here are some links:- Taxonomies - separate pages based on categories, tags etc. Shortcodes - Shortcodes are simple snippets inside your content files calling built-in or custom templates. Here’s an example I did. Templates - Hugo provides many templating options from the homepage to 404 not found page. Hugo pipes - Hugo Pipes is Hugo’s asset processing set of functions. This can be used to get data from local files or remote servers.…