Skip to content

Instantly share code, notes, and snippets.

@manics
Created August 13, 2025 14:15
Show Gist options
  • Save manics/d8bc859cf84af4943e481baf7767281a to your computer and use it in GitHub Desktop.
Save manics/d8bc859cf84af4943e481baf7767281a to your computer and use it in GitHub Desktop.
Hugo example

Hugo Tutorial

Based on https://gohugo.io/getting-started/quick-start/

  1. Install hugo https://gohugo.io/installation/
  2. Go to https://themes.gohugo.io/ and pick a theme, e.g. Terminal
  3. Initialise a new site:
    hugo new site my-new-site
    cd my-new-site
    
  4. Add a theme, either by downloading it, or by adding a Git submodule:
    wget https://github.com/panr/hugo-theme-terminal/archive/refs/heads/master.zip
    unzip master.zip
    mv hugo-theme-terminal-master themes/terminal
    rm master.zip
    
  5. Configure hugo to use the theme
    echo "theme = 'terminal'" >> hugo.toml
    
  6. Build the website, files will be placed under the public/ folder
    hugo build
    
  7. Alternatively run a live server that automatically rebuilds the website when files are changed
    hugo server
    
  8. Now create some content. This will create a new page content/posts/my-first-post.md with some predefined metadata, but it's easy to create it yourself. If you are running hugo server the browser view should automatically update
    hugo new content content/posts/my-first-post.md
    
  9. Now add some content to the above page.
    echo '## Hello from the cHICkens!' >> content/posts/my-first-post.md
    
  10. Now modify the theme, e.g. edit [my-new-site/themes/terminal/layouts/_default/single.html](my-new-site/themes/terminal/layouts/_default/single.html) and insert some text inside the {{ main }}` block
    sed -i '' '1a\
    πŸ“πŸ“πŸ“πŸ“πŸ“πŸ“πŸ“πŸ“πŸ“πŸ“' themes/terminal/layouts/_default/single.html
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment