Skip to content

Can this be used with variables? #4

@rupl

Description

@rupl

I've been trying to dynamically inline images. My use case is a gallery and I have pre-generated 32x32 thumbs of images. I know the location of these thumbnails within my codebase and my idea was to use capture:

{% capture imgsrc %}/img/path/to/thumb.jpg{% endcapture %}

Then I could loop through my gallery and inline the thumbs. But no matter what format I try to pass to the {% base64 imgsrc %} tag via this variable (full URL, absolute path, system path), it always reports the following:

Liquid Exception: No such file or directory - imgsrc in _includes/gallery.html, included in _posts/my-gallery-file.md

When I hardcode the URL I was trying to capture in a variable, the data URI outputs just fine.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions