Skip to content
Grav 2.1 is out: every page speaks Markdown. Read the announcement →

Displaying page media @2x

Started by Oyed 8 years ago · 1 replies · 575 views
8 years ago

I have 2 questions:

  1. Is it possible to use density tags in the srcset instead of width? E.g. srcset="path-to-file.png 2x"

  2. If the above isn't possible, can I retrieve a 2x image manually? When using the following: page.media[page.header.image_logo].url it gives me the 1x image (I uploaded a 2x image), is it possible to get the 2x image URL?

Thanks

8 years ago

I have no experience with image densities myself, but have you read the docs about Responsive images?

Suggested topics

Topic Participants Replies Views Activity
Themes & Styling · by FrViPofm, 18 hours ago
1 34 5 hours ago
Themes & Styling · by stuart young, 1 month ago
3 480 1 month ago
Themes & Styling · by Sebadamus, 2 months ago
5 481 2 months ago
Themes & Styling · by martynfoster735, 2 months ago
1 460 2 months ago
Themes & Styling · by Justin Young, 2 months ago
1 490 2 months ago