The WolfspyreLabs Blog/ 2024/ Posts from April/ Multilanguage archetypes/ Multilanguage archetypes Making it a bit easier to get thoughts outβ’οΈ. looking around, I didn’t find a lot of good guidance on using archetypes in a multilang site context. here’s what I’ve found: inside your project’s archetypes folder, create a subfolder per lang: . (wpl_main)$ tree archetypes/ archetypes/ βββ brk β βββ wplblog.md β βββ year.md βββ default.md βββ post.md βββ wplblog.md βββ year.md 2 directories, 6 files then, assuming a content structure like: tree . βββ 2021 β βββ April β β βββ _index.brk.md β β βββ _index.md β βββ August β β βββ _index.brk.md β β βββ _index.md β βββ December β β βββ _index.brk.md β β βββ _index.md β βββ February β β βββ _index.brk.md β β βββ _index.md β βββ January β β βββ _index.brk.md β β βββ _index.md β βββ July β β βββ _index.brk.md β β βββ _index.md β βββ June β β βββ _index.brk.md β β βββ _index.md β βββ March β β βββ _index.brk.md β β βββ _index.md β βββ May β β βββ _index.brk.md β β βββ _index.md β βββ November β β βββ _index.brk.md β β βββ _index.md β βββ October β β βββ _index.brk.md β β βββ _index.md β βββ September β β βββ _index.brk.md β β βββ _index.md β βββ _index.brk.md β βββ _index.md βββ 2022 β βββ April β β βββ _index.brk.md β β βββ _index.md β βββ August β β βββ _index.brk.md β β βββ _index.md β βββ December β β βββ _index.brk.md β β βββ _index.md β βββ February β β βββ _index.brk.md β β βββ _index.md β βββ January β β βββ _index.brk.md β β βββ _index.md β βββ July β β βββ _index.brk.md β β βββ _index.md β βββ June β β βββ _index.brk.md β β βββ _index.md β βββ March β β βββ _index.brk.md β β βββ _index.md β βββ May β β βββ _index.brk.md β β βββ _index.md β βββ November β β βββ _index.brk.md β β βββ _index.md β βββ October β β βββ _index.brk.md β β βββ _index.md β βββ September β β βββ _index.brk.md β β βββ _index.md β βββ _index.brk.md β βββ _index.md βββ 2023 β βββ April β β βββ _index.brk.md β β βββ _index.md β βββ August β β βββ _index.brk.md β β βββ _index.md β βββ December β β βββ _index.brk.md β β βββ _index.md β βββ February β β βββ _index.brk.md β β βββ _index.md β βββ January β β βββ _index.brk.md β β βββ _index.md β βββ July β β βββ _index.brk.md β β βββ _index.md β βββ June β β βββ _index.brk.md β β βββ _index.md β βββ March β β βββ _index.brk.md β β βββ _index.md β βββ May β β βββ _index.brk.md β β βββ _index.md β βββ November β β βββ _index.brk.md β β βββ _index.md β βββ October β β βββ _index.brk.md β β βββ _index.md β βββ September β β βββ _index.brk.md β β βββ _index.md β βββ _index.brk.md β βββ _index.md βββ 2024 βββ April β βββ _index.brk.md β βββ _index.md βββ August β βββ _index.brk.md β βββ _index.md βββ December β βββ _index.brk.md β βββ _index.md βββ February β βββ _index.brk.md β βββ _index.md βββ January β βββ _index.brk.md β βββ _index.md βββ July β βββ _index.brk.md β βββ _index.md βββ June β βββ _index.brk.md β βββ _index.md βββ March β βββ _index.brk.md β βββ _index.md βββ May β βββ _index.brk.md β βββ _index.md βββ November β βββ _index.brk.md β βββ _index.md βββ October β βββ _index.brk.md β βββ _index.md βββ September β βββ _index.brk.md β βββ _index.md βββ _index.brk.md βββ _index.md 53 directories, 104 files and having the following content in archetypes/brk/wplblog.md and archetypes/wplblog.md {{ $DAYT := replaceRE "((([0-9]{4})-([0-9]{2})-([0-9]{2})))-(.*)" "$1" .Name -}} {{ $YYY := replaceRE "((([0-9]{4})-([0-9]{2})-([0-9]{2})))-(.*)" "$3" .Name -}} {{ $MMM := replaceRE "((([0-9]{4})-([0-9]{2})-([0-9]{2})))-(.*)" "$4" .Name -}} {{ $DAY := replaceRE "((([0-9]{4})-([0-9]{2})-([0-9]{2})))-(.*)" "$5" .Name -}} {{ $TYTL := replaceRE "((([0-9]{4})-([0-9]{2})-([0-9]{2})))-(.*)" "$6" .Name -}} --- categories: [''] contributors: ['evey-noblewise','atticus-skwirrelbane','penny-wise','anni-wise','wolf-noble'] date: {{ $DAYT }} draft: true kind: 'page' #values are page, home, section, taxonomy, or term. publishDate: {{ $DAYT }} series: [posts] slug: '{{ $TYTL| lower}}' description: '{{ replace $TYTL "-" " " | title }}' summary: '{{ replace $TYTL "-" " " | title }}' tags: ['{{$YYY}}'] title: '{{ replace $TYTL "-" " " | title }}' type: 'posts' weight: {{$DAY}} --- Stuff I think is interesting, cool, or otherwise worth sharingβ’οΈ. Categories: 'enumerate' 'categories' 'you' 'use' 'here' Tags: 'emumerate' 'your' 'oft' 'used' 'tags' 'here' `hugo new 2024/April/2024-04-00-Example-Name.brk.md --kind brk/wplblog` `hugo new 2024/April/2024-04-00-Example-Name.md --kind wplblog` or... to save on postage title=hugo-tips; K=wplblog; PFX="`date +%Y/%B/%Y-%m-%d-`${title}" ; hugo new ${PFX}.md --kind ${K} && hugo new ${PFX}.brk.md --kind brk/${K} then, you’ll have an easy near-one-liner to adapt for any style of post. Set the environment var title in the first bit; and the variable K to the kind which aligns with the filename in your archetypes folder. then iterate through the ‘default’ lang, and any other language you want to generate content for. There’s likely a better way to do this that I’m just not aware of yet. Git_Repos/Wolfspyre.com/docker/blogsite (wpl_main)$ title=Hugo-Tips; K=wplblog; PFX="`date +%Y/%B/%Y-%m-%d-`${title}" ;hugo new ${PFX}.md --kind ${K} && hugo new ${PFX}.brk.md --kind brk/${K} Content "/Users/loiosh/NextCloud/Git_Repos/Wolfspyre.com/docker/blogsite/content/2024/April/2024-04-11-Hugo-Tips.md" created Content "/Users/loiosh/NextCloud/Git_Repos/Wolfspyre.com/docker/blogsite/content/2024/April/2024-04-11-Hugo-Tips.brk.md" created edit, post, repeat.