
More messing around with Hugo and static site generation..
I’m not professing to know much but any notes I make about Hugo are mostly going on the PlumObsian’s Digital Garden
I’ve dumped them under Software>Hugo but the garden should be searchable if you really have some weird reason to be interested in my experiments..
Setting up new post archetypes in Hugo
In the “archetypes” folder you can set up some templates for new post or content types.
You can start by editing the default and saving as a youtube.md archetype.
Something like this;
---
title: "{{ replace .File.ContentBaseName "-" " " | title }}"
date: {{ .Date }}
type: "post"
tags:
- "Music"
- "Youtube"
image: "youtube/someimage.jpg"
description: ""
categories:
- "Music"
---
From your base Hugo directory you can now use the “-k” flag for a new post to use this archetype template. I think if you remove the default then hugo should determine the post type intelligently from the directory structure..
hugo new -k youtube content/blog/youtubel/mynewyoutubepost.md