How to have custom single.html post for each individual product/post

Try it:

git clone --single-branch -b hugo-forum-topic-37085 https://github.com/jmooring/hugo-testing hugo-forum-topic-37085
cd hugo-forum-topic-37085
hugo server
content/
├── products/
│   ├── _index.md
│   ├── product-1.md  <-- front matter: layout = 'product-1'
│   ├── product-2.md  <-- front matter: layout = 'product-2
│   ├── product-3.md  <-- front matter: layout = 'product-3'
│   └── product-4.md
└── _index.md
layouts/
├── _default/
│   ├── baseof.html
│   ├── home.html
│   ├── list.html
│   └── single.html
└── products/
    ├── list.html       <-- used by content/products/_index.md
    ├── product-1.html  <-- used by content/products/product-1.md
    ├── product-2.html  <-- used by content/products/product-2.md
    ├── product-3.html  <-- used by content/products/product-3.md
    └── single.html     <-- used by content/products/product-4.md
2 Likes