Hugo setup notes
This post is a note for hugo setup currently for this site
> hugo new site
git submodule lives under
catg.kghs.net/ instead of root, might not be what I want…?
Now using a forked minimal bootstrap theme to add support for using google-fonts. Followed the gist but with a tweak, minimal bootstramp theme doesn’t load .scss so
the font family declaration css lives in
head.html instead. See PR for detail?
setup to deploy to S3 bucket; configuration is mainly in
[deployment] section within
S3 bucket was setup with static web hosting but somehow still need to specify an policy to the bucket otherwise
hugo deploy will make everything private again and cause 403 on each deploy
relies on IAM configured with
aws configure; nothing other than bucket is in the hugo config.
SSL configured via AWS CloudFront with cert issued using AWS Certificate Manager; Follow This AWS step-by-step setup on how to do it. Gotchas
- Cert should be created in
us-east-1region or CloudFront won’t be able to find it when creating distribution.
- Origin when creating a CloudFront Distribution should be in
<site>.s3-website-<region>.amazonaws.com, NOT just pick a s3 bucket from the dropdown. Using dropdown assumes you are forwrading REST request not regular web request.
Also need to make sure
baseURL in site
https:// instead of
bootstrap.min.css will be served from non-secure location causing error in Chrome/Brave browsers.
hugo new [path] where
[path] format right now should be
post/name-of-post.md otherwise the theme doesn’t pick up and create links corresponding posts; also need to make sure
.md file extension is there or it might be hard to do things down the road.
Just defined a few
archtype template, and when creating new content should use
hugo new --kind type [path] where
[path] is the same format as above; so for example
> hugo new --kind novel post/novel/imouza-4.md
creates a new post of kind novel from template defined under
edit and preview
hugo server -D which should include posts that has
draft: true status
Currently publishing involves editing on laptop then run
hugo to generate site. Thinking how to create posts on mobile.
One possible route
site/contentfolder live on Dropbox
- create/edit content on mobile via DbApp
Problem: Windows doesn’t follow symlink so doesn’t really work well with
- Solved: Need to use
mklinkcommand in windows command prompt; the command doesn’t work under
gitdoes not recognize symlink so the whole site still need to be stored in Dropbox.
Things to consider with this route:
- editor on mobile
iA editor seems to work?Not really :-/
- the only thing worked is Dropbox TextEditor opened from Dropbox
- no way to trigger update, still need to get back to a laptop
needs to think about
- correct fonts and syntax highlighting for programming related posts; Noto serif doesn’t go well for programming posts. Should think about this more if more technical posts are ever written…