Hey guys ! I wondered lately how to pull in a picture, whose path is given in the header. Thanks!
Archive
As markdown is processed before twig, you won't be able to inject a page header variable with twig into a markdown image tag.
However, you could just put a full path to the image and use a regular HTML image tag with the URL set from the page header:
YAML
image_url: /some/path/to/image.jpg
process:
twig: true
And then this in the content or in a twig template:
TWIG
<img src="{{ page.header.image_url }}" />
Log in to reply.
Suggested topics
| Topic | Participants | Replies | Views | Activity |
|---|---|---|---|---|
| 0 | 1318 | 9 years ago | ||
| 2 | 915 | 9 years ago | ||
| 2 | 4044 | 9 years ago | ||
| 1 | 2920 | 9 years ago | ||
| 3 | 1104 | 9 years ago |