Skip to content
Grav 2.0 is officially stable. Read the announcement →
Archive

Sizes with media queries in markdown

Started by Muut Archive 10 years ago · 1 replies · 893 views
10 years ago

I wonder what the status of using the sizes option with media queries in markdown is. It would be nice to be able to get control of my pictures on different displays...

10 years ago

Seems to be possible to do it with Twig like this:

HTML

===
title: About me
process:
  twig: true
===
<div style="float:left;margin:2rem 2rem 1rem 1rem">
{{ page.media['myimage.jpg'].derivatives(250,450,100).sizes('(min-width:50em) 17vw, 17vw').html() }}
</div>

This text wraps around image

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1361 9 years ago
Archive · by Muut Archive, 9 years ago
2 939 9 years ago
Archive · by Muut Archive, 9 years ago
2 4069 9 years ago
Archive · by Muut Archive, 9 years ago
1 2958 9 years ago
Archive · by Muut Archive, 9 years ago
3 1123 9 years ago