I realize that it should be something like this: {filename}path/to/file
or {attach}path/to/file
but how to specify path in the template <img src="?"/>
in order to render properly?
Asked
Active
Viewed 50 times
0

Alex
- 153
- 7
1 Answers
0
What you are looking for is {static}path/to/file
.
Furthermore, you don't have to specify the img
tag in your templates.
Pelican (or rather docutils) takes care of it.
Edit:
With regard to lay-out, I tend to use:
.. image:: {static}/path/to/image.jpg
:width: 100%

Roland Smith
- 42,427
- 3
- 64
- 94
-
Static content which the same for every page I'm linking in the base template this way (
– Alex Nov 14 '21 at 08:48
-
`{static}` works with images in articles. See elso https://docs.getpelican.com/en/latest/content.html#linking-to-static-files. – Roland Smith Nov 14 '21 at 11:42
-
It kind of "works". But how to style such image? It break my layout. – Alex Nov 14 '21 at 12:02
-
See updated answer. If you are using a custom theme, you will probably have to show the – Roland Smith Nov 14 '21 at 12:26
-
This is rst sintax. I'm using Mardown. I've fixed styling by applying styles to the img nested in p tag. – Alex Nov 14 '21 at 18:27