I wanted a base template that set out a common layout, then two example of pages that used that layout to render content with a custom title. This is

The most basic possible Hugo site

submited by
Style Pass
2024-10-23 10:00:07

I wanted a base template that set out a common layout, then two example of pages that used that layout to render content with a custom title.

This is my first time ever trying out Hugo so it's quite possible there's an even simpler approach, but this is what I got to.

Note that index.html and single.html are identical. I'm not sure why Hugo needed both - the index.html file is used for the homepage.

Note that both of these have frontmatter at the top to define the title. This seems to be the right pattern for combining HTML content and Markdown content in the same project.

_index.md has a special role in Hugo. It allows you to add front matter and content to home, section, taxonomy, and term pages.

I haven't actually deployed a Hugo site yet, but I expect I'll try this using either GitHub Pages or Netlify or Cloudflare Pages soon.

Leave a Comment