robwierzbowski / jekyll-image-tag

Better images for Jekyll.
BSD 3-Clause "New" or "Revised" License
98 stars 26 forks source link

Generate image and giving it back as url without wrapping it into a <img> #9

Closed Phlow closed 10 years ago

Phlow commented 10 years ago

Hello Rob, hello everyone!

I have a question/feature request:

By default your plugin always wraps a generated image into an <img>-Tag. But for a gallery (or lightbox plugin) I would like to generate thumbnails and link to a bigger generated version. But for this to work with the jquery-plugin I just need the url of the new generate image. Is this possible?

Here is the code i want to generate.

Frontmatter


---
layout: posting
title: "2013-12-12 // Supertest"
image: 
    - 2013-11-11-foto-1.jpg
    - 2013-11-11-foto-2.jpg
    - 2013-11-11-foto-3.jpg

---

Template

<ul class="clearing-thumbs" data-clearing>
{% for image in page.image %}
    <li><a href="images/{{ image }}">{% image thumb {{ image }} class="th" %}</a></li>
{% endfor %}
</ul>

Instead of <a href="images/{{ image }}"> I would like to use a generated image by your plugin. The jquery-plugin is a plugin by foundation framework called clearing.

There could be two ways to implement this:

Via new tag like {{ image-url }} or an additional parameter like url.

I would suggest the parameter-style because this way you can configure it in the _config.yml as a preset.

What do you think?

robwierzbowski commented 10 years ago

Good idea. I have no preference, tag or param. The param list is a little long now, so tag might be better.

This repo is lower on my todo list, so not sure when I'll get to it. If you or others want to implement it, please do.

fregante commented 10 years ago

I know no Ruby so I took the shortest path possible and used a parameter. See commit below:

robwierzbowski commented 10 years ago

At some point I'm going to pull the image-processing lib out of this and jekyll-picture-tag and make it a standalone. I plan on building this feature into that new gem. Contributors welcome.