I am trying to attach an image in Pelican, following the documentation here. Here is the markdown:
![energy]({filename}images/energy.png)
and the pelicanconf.py:
PATH = 'content'
STATIC_PATHS = ['images', 'pdfs']
ARTICLE_URL = 'blog/{date:%Y}/{date:%m}/{slug}.html'
ARTICLE_SAVE_AS = 'blog/{date:%Y}/{date:%m}/{slug}.html'
The .html
files are written into output/YYYY/MM/
directory where the markdown gets interpreted as:
<img alt="energy" src="{filename}/images/energy.png"/>
in the .html
while the images are written into output/images
folder.
So the HTML files cannot find the images. How do I fix it? Ideally, I would like to store the images in the same folder as the .html
files (I think that is what {attach}
does).
Any help would be appreciated.
{attach}
is not recognized at all; I get the following error message:ERROR: Better Fig. Error: image not found: [~]/pelican/content/{attach}energy.png
when the image and markdown are in the same folder. I am using pelican 3.6.3, so that is strange. – Tussis