Hugo is a general-purpose website framework. Technically speaking, Hugo is a static site generator. Here are my notes , I tried three times, the most recent attempt in Dec 2022. …
Oops
I lost my source tree, and it’s not easy to re-engineer; there’s nothing on google but I tried chatgpt which yielded this reply. This points at pandoc, and google bard suggests, as alternatives, Google with AI Perspectives offers this.
If you’re looking for alternatives to Pandoc, depending on your specific needs, you could consider options like: AsciiDoc, R Markdown (with knitr), Quarto, Markdown editors with built-in conversion features (like Typora or Visual Studio Code), or dedicated document conversion tools depending on the specific file formats you need to convert between, while keeping in mind that Pandoc’s versatility in handling a wide range of formats might be hard to match
Version 3
I had another go, it seems I have forgotten a lot. The ananke theme has changed and is now very ugly.
- https://gohugo.io/getting-started/quick-start/, from download to publication; remains useful
- 40+ Best Completely Free Hugo Themes For 2022, they claim top 40 free, I found elate and educentre
- hugo theme: introduction, this is the theme I chose to use, which I found in Hugo’s directory
- A hint on directory structures, https://www.jakewiesler.com/blog/hugo-directory-structure
- https://merrimanlab.github.io/post/2020-10-15-making-posts/
To create a publication candidate, use hugo
with no parameters unless the -t parameter is needed to force a theme. It creates a folder public in the folder containing the config.toml. The target public folder needs to be empty. I run hugo from ./examplesite. There is a bug on the 404 page.
I need to run hugo new from ./examplesite specifying the name of the markdown file with a relative path. and reference to the theme folder e.g.
hugo new ../content/$lang/blog/${name}.md -t ../..
Draft needs to be false to be pushed into the local server
Version 2
It seemed easy but wasn’t. I was helped by the getting started page again 🤓 My target is a static site on AWS/S3, but it seems I could use git. In fact, I gave up on amazon because they charge extra and complicate the delivery over https.
Version Update
I am writing some code, and this is incredibly useful, it documents how to find the latest release. I wrote a script https://github.com/dfl1955/ubuntu-tools/blob/master/whathugoversion to perform this role, but at my version three, I was using apt to install it. i.e. my script 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.
Introduction uses icons from fontawesome.com
On themes
As at Version 3, I made a site using introduction, also boosted here, the latter contains instructions on using the git module. I also tried to restore my old version based on ananke. , which remains quite old; I may have lost the development tree.
For version 1, I kept to the trial version, ananke. For version two I found Harbor, Air and Greyscale these are now still available in git
Harbor looks cool, but its install is not simple, it throws an error; there seems to be a missing template somewhere. I found some help in using it.
On Hugo Air, this is rather fab because of its header picture, I had a problem getting the menu to work. When I rteurned to it in 2022, I made a post exclusively for the Air theme,
Greyscale is still going, I see why I liked it. @github
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,
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.
- https://gohugo.io/content-management/static-files/
- https://github.com/budparr/gohugo-theme-ananke/issues/176
- It might be to do with the generator and the source and target files.
My first go!
Two lessons,
- On Ubuntu, don’t use
apt-get
, at least not on AWS. it’s very old and doesn’t work, use the release code anddpkg
- 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
- 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 - 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 viagit
? Orcpio
, both or either it would seem. cpio for intra-system, git between systems? - The hugo program CLI documentation, here …
- 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.
Publication
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 .md 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 regenerating the site i.e. running hugo -t $themename
.
How to deploy
I found the following hard to find, How to deploy a Hugo Site?
- Build it using the instructions here …
- Ensure your content files are not
draft = true
. - Run
hugo -t $themename
., which will create a./public
directory - Copy the contents of the
./public
directory to your html root directory.
BaseURL Parameter
Some of the hyperlinks have this value copied into the URL, this ties the site to the hostname
. I wonder why they do this? gohugo.io – getting-started configuration/ lists the parameters including baseURL
, relativeURL
and canonifyURL
. Today the baseURL
should/must be an https
name. This thread discusses the use of baseURL and transitioning from dev to prod.
Misc.
There are wordpress converters!
The default RSS is at BaseURL/index.xml.
Amended today!
I had another go today, it didn’t work so I need to continue with it; lots of links
I amended the page, the non-displaying image was because AWS S£ don’t support https. I have made another page to discuss AWS & Web Sites.
I could use git as my file store it seems, I added the comment and link to the site
I tidied the page up today, and added the comment on tachyons and social media buttons
I have started again, and retired these comments; I installed using the download & gdebi technique described here.
draft = false
, and made the publish folder usinghugo -t ananke
from the project home directory.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.The comments on reverse-engineering were added.
I found this https://hugoconf.io/hugoconf-2022/ , wonder if 2023-24 have heppened.