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.
I was expecting the markdown syntax for images to work, ie::
![the blue duck](duck.jpg)
It’s not clear to me as a newcomer how Page Properties are supposed to work in Markdown, if at all? Does the following look right? (It definitely doesn’t appear to work).
![the blue duck]({{ (.Resources.GetMatch "duck.jpg").RelPermalink }})
Actually, I think what I need is a custom shortcode - this link is starting to make more sense to me:
I’ll give this a go and let you know if that works. Do you think it’s worth submitting a pull request to improve support for the Markdown renderer? I would kind of expected it to work that way out of the box.
Edit: Nope, I’m pretty certain I’m doing something dumb - I’ll keep trying. Thanks and definitely open to suggestions on how to do this different or better.