Default image for twitter card

When I use the internal twitter card template via {{ template "_internal/twitter_cards.html" . }} I can choose an image in my content files like this:

---
images:
- /images/foo.jpg
---

The template takes the first image in the dict.

How can I set a default image that gets inserted if no image was set or when index.html is displayed?

I tried with

[params]
    images = ["/images/logo.jpg"]

But this does not work.

The embedded template doesn’t support that. You can copy the embedded template into your layouts as a partial template and add the Site Params support yourself.

1 Like