Page bundles templates

G’day folks
my site structure requires that i create a few folders and files every time i create a new page.
for instance

content/
├── about
│   ├── index.md
├── shop
│   ├── item-1
│   │   ├── images
│   │   │     ├── 1_img.jpg
│   │   │     ├── 2_img.jpg
│   │   │     └── 3_img.jpg
│   │   │
│   │   ├── buy-button-1.html
│   │   ├── buy-button-2.html
│   │   │ 
│   │   └── index.md

is there a way to make a tamplate that will create subfolders and empty files when i create a new shop page? instead of making them manually.

hugo new shop/item-1/index.md

next best thing. running a script before the page bundle is created ?

appreciate any feedback
thanks

See https://gohugo.io/content-management/archetypes/#directory-based-archetypes

archetypes/
├── shop/
│   ├── images/
│   │   └── .gitkeep  # See https://github.com/gohugoio/hugo/issues/9766
│   ├── empty-file-1.html
│   ├── empty-file-2.html
│   └── index.md
└── default.md

The create new content with:

hugo new shop/item-1
1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.