Hugo
Summary #
Static site generator. Uses markdown format as source.
Install #
snap install hugo
snap install hugo --channel=extended # for you need the extended version to build SCSS/SASS.
Run local server #
From the directory that contains the hugo project, e.g. “/mnt/data/Dropbox/emacs/hugo/braindump”
cd /mnt/data/Dropbox/emacs/hugo/braindump
hugo server --config config.yml # to select the config file to build the project and run
# in side netlify.toml, file build command
command = "hugo --gc --minify --config config.yml"
Documentation #
Getting started with a theme #
e.g.: https://github.com/gethugothemes/liva-hugo
git clone git@github.com:gethugothemes/liva-hugo.git
# cd in the project directory
$ cd liva-hugo/exampleSite/
# Start local dev server
$ hugo server --themesDir ../..
To use `hugo server` command, copy the theme to “themes” directory: ``` copy-example-site-here themes/live-hugo ```
Editing layouts #
Issue I faced with my brain dump #
The list view was appearing, I disabled the
profileMode:
enabled: false
title: PaperMod
in `layouts/_default/list.html` it checks for this variable to render list. details about templates here
Ordering list #
in the list.html
- range $index, $page := ($paginator.Pages.ByParam "lastmod").Reverse
enableGitInfo: true
lastmod: ["lastmod", ":fileModTime", ":default"]
hideMeta: false
#
stackoverflow hugo doc discourse hugo hugo post dates in the hugo pages stackoverflow
Note: To enable adding “lastmod” property to every post set
(setq org-hugo-auto-set-lastmod t)
Partial templates #
HUGO ref Used in Org Roam to display linked notes in the rendered Hugo md format of each node, ref.
Installation #
Installing Hugo On Ubuntu 18.04 / Debian 10 from .deb package To install Hugo on Ubuntu 18.04 / Debian 10 from Debian package, first, download the latest release from Github releases page https://github.com/hugo/releases/. Select a version that matches your CPU architecture:
curl -s https://api.github.com/repos/gohugoio/hugo/releases/latest \
| grep browser_download_url \
| grep Linux-64bit.deb \
| grep -v extended \
| cut -d '"' -f 4 \
| wget -i -
Org Mode to Hugo #
I used https://github.com/benmezger/blog theme to export Org Roam to markdown for hugo
Hugo commands #
hugo list help
https://gohugo.io/commands/hugo_list/