Hi there,
It seems like there are a lot of image-related issues people are having, and everyone wants to configure things differently, so everyone seems to have their own specific requirements. I wasn’t able to find anything that applied to my case, so my apologies if I’m just missing something and duplicating content.
Here’s what I’m trying to do.
I’ve got a blog set up using the middleman-blog extension. The URL structure of that blog is (intended to be) as follows:
- Homepage: /
- Article: /year/mm/article-title/
- Pages: /page/n/
- Images: /year/mm/article-title/image.jpg
Before building, I’m storing all images and articles as follows:
/content/post_title.md
/content/post_title/image.jpg
I’m specifying my images in markdown as follows:
[pic]: post_title/image.jpg “Image”
The result I’m seeing is that on the actual direct link to the article page, the image shows correctly, but on any other pages, the links point to the following invalid URL:
/img/post_title/image.jpg
What I want is for all links to become absolute links to the same location (in /year/mm/article_title/) throughout the site.
I suppose I could use the helper from this thread: Full image URLs in generated site – which would require me to convert all my URLs to the format /year/mm/article_title/image.jpg and just prefix the appropriate hostname depending on whether I’m in development mode or in production.
But that seems like an awfully wonky way to make something that feels like it should be a pretty basic scenario work. Is there something I’m missing here? What is the expected way to achieve this?
To be clear, I’m not enabling any sort of relative links or assets in my config.rb.
Thanks in advance!