serhii.net

In the middle of the desert you can say anything you want

24 Sep 2021

Day 997

Hugo the static site generator

My blog takes minutes to be generated, this DTB is not far from it either. I heard Hugo is fast, and I dislike most of what’s on my blog, the logical thing seems to burn it to the ground and start from zero using Hugo.

cd themes
git submodule add https://github.com/chollinger93/ink-free
cd ..
echo theme = \"ink-free\" >> config.toml
  • Creating a post:
hugo new posts/my-first-post.md

puts the file in ./content/posts/my-first-post.md

  • Building:
    • Starting the local server: hugo server -D
    • REALLY fast, and reloaded live in my browser!
    • Building the site: hugo -D
  • Configs
    • config.toml supports #comments
    • con-fig and con-tent in the same folder make my tab completion sad.
    • Configure Hugo | Hugo
    • It supports .yaml, .json and .toml configs and config directories!
  • Directory structure: Directory Structure | Hugo
    • Site structure in inferred by directories: Content Sections | Hugo
      • They still need to be added to config to be in the menu
      • Nevertheless accessible when typing the URL directly
      • A subdirectory is a navigable section only if it has an _index.md
    • hugo new content/pages/one/two/test-page.md
      • The command only from parent of config
      • It generates the boilerplate, I don’t need to write a script for that! It even gets the title from the filename!
      • If there’s an archetype with the same name it’ll use that!
  • Writing / content creation
Nel mezzo del deserto posso dire tutto quello che voglio.
comments powered by Disqus