This document assumes you have Hugo 0.52 or newer installed. Use the hugo version
command to determine which version you have access to. Once the steps below have been followed to set up Hugo we will migrate an existing site so that it can be managed by it.
hugo new site <your directory's name>
mv config.toml config.yml
languageCode: "en-us"
title: "Your site's name"
resources
directory which isn't covered in the official documentation. It is a resource cache where generated files, such as images, are stored.assets
directory needs to existstatic
directoryassets
directory and copy your style sheet to that location:mkdir -p assets/css
cp ~/path/to/your/style.css assets/css/
style.css
use the following lines in your template{{ $style := resources.Get "css/style.css" | minify | fingerprint }}
<link rel="stylesheet" href="{{ $style.Permalink }}">
rm -rf archetypes data themes
mkdir -p layouts{_default,partials,shortcodes}
hugo server
We will make changes to the Social Justice Repair Kit site so that it can be managed using Hugo.
static
directorylayouts/partials/
directory create templates that will be commonly used by other pages, for example, header.html
and footer.html
These will be referenced by other files using the partial
keywordlayouts/_default/baseof.html
template that contains general markup that will be used by every pagelayouts/_default/list.html
template which will be used by every section's index page in your sitelayouts/index.html
template that will be used by the home pagecontent
directory which will make up the majority of site maintenance workIt would be ideal if the majority of user managed content is authored solely using markdown with a minimal amount of shortcodes. One way of accomplishing this is by splitting up markdown files in the content
directory, including a type property in the front matter, and then referencing that type property in layout templates where most of the markup can live.
So far the Inclusive Cities and Social Justice Repair Kit projects have used Hugo to maintain content and only a subset of its features have been tested. As we use it for other projects we will most likely need to spend time trying out the following features: