diff --git a/content/notes/adding-post-type-hugo.md b/content/notes/adding-post-type-hugo.md new file mode 100644 index 0000000..e4a8843 --- /dev/null +++ b/content/notes/adding-post-type-hugo.md @@ -0,0 +1,61 @@ +--- +title: "Adding another post type to Hugo" +date: 2025-12-14T7:30:00+02:00 +draft: false +subtitle: "How I added notes as content type to hugo in addition to the standard posts and pages." +--- + + +Notes are short posts that focus on a small bit of information. Other than my blogposts they do not try to give a +complete picture or a full explanation. They are more of a brain-dump of mine with a low bar of typing them out. + +So how did I add them? + +1. **Create a notes folder:** The folder in `content/notes` will hold the notes +2. **Add rendering template:** Hugo needs to know what to do here, so add a rendering template in + `layouts/notes/list.html`. A sample is provided below. +3. Add `content/notes/_index.md` with a short explanation of the + +### Styling template + +```html +{{ define "main" }} +Notes + +
+ {{ .Content }} +
+ + + +{{ end }} + +``` + +As you can see, I added an optional subtitel. They make it much easier to find a note that is interesting, but should +not be necessary to lower the bar for the author. Subtitles can be specified like this + +```markdown +--- +title: "Adding another post type to Hugo" +date: 2025-12-14T7:30:00+02:00 +draft: false +subtitle: "How I added notes as content type to hugo in addition to the standard posts and pages." +--- + + +Notes are short posts +``` \ No newline at end of file