<
picture
>
<
source
srcset
=
"smaller.jpg"
media
=
"(max-width: 768px)"
>
<
source
srcset
=
"default.jpg"
>
<
img
srcset
=
"default.jpg"
alt
=
"My default image"
>
</
picture
>
.. raw:: html
<picture>
<source srcset="smaller.jpg" media="(max-width: 768px)">
<source srcset="default.jpg">
<img srcset="default.jpg" alt="My default image">
</picture>
To avoid repeat in yourself too much you may want to look at shortcodes in the Nikola manual, too.
--
You received this message because you are subscribed to the Google Groups "nikola-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nikola-discus...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Actually, the raw shortcut is not what I meant. It's late and I am on the phone but I will reply with a decent example tomorrow.
To unsubscribe from this group and stop receiving emails from it, send an email to nikola-discus...@googlegroups.com.
<
picture
>
<
source
srcset
=
"${args[0]}"
media
=
"(max-width: 768px)"
>
<
source
srcset
=
"${args[1]}"
>
<
img
srcset
=
"${args[1]}"
alt
=
"${alt}"
>
</
picture
>
Then you can do this in any post:
{{% picture small.jpg default.jpg alt="My Image"%}}
And you will get the markup you want.