To have a cleaner layout, I want each of my posts to reside in its own directory along with all required assets like images and the like. Is this possible with hugo or any similar tool? If so, how?
The problem is that files alongside each post don't get copied into the same www export directory as the corresponding post's html file (or, alternatively, image urls reconstructed using the proper final location).
I found a solution for Hugo.
Front matter (omit url):
---
author: abc
date: 2019-01-14 21:23:43+00:00
draft: false
title: 'bla'
type: post
---
Markdown post file is an index file now:
hugo new 2019-01-14-your-post-title/index.md
That way you won't have /2019/01/14/your-post-title urls, you get /2019-01-14-your-post-title/ instead, which is fine by me. Now you can put images into content/2019-01-14-your-post-title/ and reference them from the markdown index.md file directly without using any paths or having to store them in a central location first.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With