GSA / digital.gov

DEPRECATED 🛑-The future site of Digital.gov
https://www.digital.gov
4 stars 4 forks source link

Research images and jekyll #18

Closed thisisdano closed 2 years ago

thisisdano commented 7 years ago

What's a good way to add images to the system and, in particular, responsive images?

thisisdano commented 7 years ago

@jeremyzilar I think I'm going to try and start with the jekyll-picture-tag jekyll plugin then go from there — perhaps we can abstract it to work in any static environment as we go

https://github.com/robwierzbowski/jekyll-picture-tag

thisisdano commented 7 years ago

I'm going to look at the exported posts and give @jeremyzilar a final component for his exporting

thisisdano commented 7 years ago

@thisisdano Are there jekyll plugins available for getting image dimensions?

thisisdano commented 7 years ago

OK, looks like I'm going to punt on responsive image for the moment. However, I've built a default image component for our legacy images.

The image.html include has the following params:

So, an example include with a local image might look like:

{% include image.html img="img/2016/05/19/clip-art.jpg" alt="Clip art of a clipboard" height="72" %}

And be rendered as:

<img src="/assets/img/2016/05/19/clip-art.jpg" alt="Clip art of a clipboard" height="72"/>

An example include with an external link might look like:

{% include image.html img="https://example.org/path/to/apple.png" alt="A red apple" %}

And be rendered as:

<img src="https://example.org/path/to/apple.png" alt="A red apple"/>
thisisdano commented 7 years ago

Updated in the wiki: https://github.com/GSA/digital.gov/wiki/Components

aalikaram commented 2 years ago

🛑DEPRECATED🛑 - Repo no longer being maintained #18