I have started migrating my personal blog over from Pelican to Hugo and I’m not sure how to tackle resources.
tl;dr - Is there a shortcode or way of referencing the
.Dir page property to properly include images when using custom permalinks?
I don’t mind restructuring my source content, but I really would love to keep images together with post markdown.
What I was doing
I want to keep each blog post in it’s own directory and house it’s assets alongside markdown, similar to how page (I think) bundles work.
This is the structure I’m using currently:
- content/ - posts/ - YYYY/ - MMDD_SHORT/ - *.md - (resources)
Additionally, I have customised the permalink in the
[permalinks] posts = "/:year/:slug/"
What I expected
Either of the following:
- Resources referenced in the front matter to be rendered to the same canonical folder as the permalink
- A short-code I could use to reference the
.Dirproperty for the
What actually happened
Image references are broken because resources are in a different location and I don’t know how to reference them.
Here’s a minimal reproduction of my problem.