HUGO

Hugo is a general-purpose website framework. Technically speaking, Hugo is a static site generator. Here are my notes …

My target is a static site on AWS/S3, but it seems I could use git.

Version 2

It seemed easy but wasn’t. I was helped by the getting started page again 🤓

Installation

I installed using the download & gdebi technique described here.

  1. https://hostadvice.com/how-to/how-to-install-hugo-on-ubuntu-18-04/
  2. https://discourse.gohugo.io/t/beginner-question-how-do-i-replace-the-gargoyles/12720/3
  3. https://inside.getambassador.com/creating-and-deploying-your-first-hugo-site-to-github-pages-1e1f496cf88d, describes how to use git as the file system
  4. I revised all the posts to set draft = false, and made the publish folder using hugo -t ananke from the project home directory.
  5. I have installed the aws client api on my dev vm.  This might allow hugo deploy to work. The manual instricutions for this are at Hugo Deploy on their web site. The first port of call for AWS seems to be Configuring the AWS CLI at AWS.

Here’s the ananke git pages.

Version Update

I am writing some code, and this is incredibly useful, it documents how to find the latest release. I paraphrase,

URL=$( curl -s https://api.github.com/repos/gohugoio/hugo/releases/latest \
| grep "browser_download_url.*deb" \
| grep "Linux-64" \
| head -1  \
| cut -d : -f 2,3 \
| tr -d  \" )

remoteVersion=$(echo $URL | cut -f8 -d"/")
localVersion=$( hugo version | cut -f5 -d" "| cut -f1 -d"-")

Also on github, in whathugoversion.

Social Media Buttons

I wanted more and tracked it from ananke via git to tachyons. The list is limited and defined and beyond me to extend. An RSS and Web site icon would be good. Most themes seem to use Tachyons CSS.

On Hugo Harbor

This looks cool, but it’s install is not simple, it throws an error; there seems to be a missing template somewhere.

  1. https://themes.gohugo.io/harbor/
  2. https://themes.gohugo.io/theme/harbor/
  3. https://discourse.gohugo.io/t/found-no-layout-file-for-html/18983
  4. https://lmgtfy.com/?q=using+hugo+harbour+theme

On Hugo Air

This is rather fab because of its header picture, I had a problem getting the menu to work.

  1. https://themes.gohugo.io/air/
  2. https://github.com/syui/hugo-theme-air/issues/7

Another theme

I found this,

  1. https://themes.gohugo.io/hugograyscale/

More

This is a you tube playlist curated by me.

AWS & https

For HUGO, the base site is defined with a protocol prefix; if using AWS S3 without cloudfront, it must be HTTP i.e. http. I have a related post on this topic,

Web Hosting on AWS (S3)

GIT

I need to work out how to hold the site in git, the current repo is here, and holds the whole build.

Once I am sorted, how to I write the site to git as a backup. I need a resource on on branches and versions. (Perhaps the whole thing is needed because some customisation occurs in the go files).

Hugo Problems

At first the prod site would not display the new image. This is now fixed but I found these HUGO links about static file management.

  1. https://gohugo.io/content-management/static-files/
  2. https://github.com/budparr/gohugo-theme-ananke/issues/176
  3. It might be to do with the generator and the source and target files.

My first go!

Two lessons,

  1. On Ubuntu, don’t use apt-get, at least not on AWS. it’s very old and doesn’t work, use the release code and dpkg
  2. The review function is tightly bound to 127.0.0.1:1313. Best not use AWS as a dev. platform, unless you have a graphic desktop. I am now using virtual box.

Some Links

  1. https://itrendbuzz.com/install-hugo-on-ubuntu/, describes how to install using the release packages & dpkg. The current runes are documented here at howto forge
  2. Can you run a hugo site from an ec2 instance? looks like you need to develop on VB or something and push to $HTML_ROOT. Is this done via git? Or cpio, both or either it would seem. cpio for intra-system, git between systems?
  3. The hugo program CLI documentation, here …
  4. This looks useful. It documents how to download all the themes, and how to make posts and pages, a photo gallery and points at some deployment tools.

The program call hugo, with or without the -t parameter generates the site which is held in a folder called ./public/, this can be the subject of your favourite copy command to relocate the site in you web server‘s html root directory.

Drafts & Public

I have created content using the hugo new posts command, this creates a .toml file with the meta data inc. the title and the post content. Content can be edited using your favourite editor, I used vi. I need to work out how to enclose images and hyperlinks at some stage. It also defaults to status draft = true. This can be changed by deleting the parameter line and regenrating the site i.e. running hugo -t $themename.

How to deploy

I found the following hard to find, How to deploy a Hugo Site?

  1. Build it using the instructions here …
  2. Ensure your content files are not draft = true.
  3. Run hugo -t $themename., which will create a ./public directory
  4. Copy the contents of the ./public directory to your html root directory.

A second yet unfulfilled look

There are more comments about the second look, this is more of a 1.5 comment.

And this theme, called “Air”. There are wordpress converters!

The default RSS  is at BaseURL/index.xml

6 thoughts on “HUGO

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.