Skip to content
This repository has been archived by the owner on Jul 19, 2021. It is now read-only.

How to use images? #833

Closed
tonyd256 opened this issue Oct 15, 2018 · 4 comments
Closed

How to use images? #833

tonyd256 opened this issue Oct 15, 2018 · 4 comments

Comments

@tonyd256
Copy link

Problem

Sorry if this is a repost. I'm struggling simply using images. I've put them in the assets/images directory and in the assets/static as well as I've tried using src='{{ "image.png" | asset_url }}' and src="{{ '../assets/static/image.png' | asset_url }}". I've read through a bunch of issues and the wiki but still can't find a consistent working solution. I was able to get images inside the svg directory working by using src="{{ '../assets/svg/image.png' | asset_url }}", but it doesn't seem like this same concept works for all those directories.

More Information

I really like the idea of this tool but I'm struggling to understand it all. Hope to help contribute to make it better once I understand it.

@tonyd256
Copy link
Author

tonyd256 commented Oct 15, 2018

So it turns out that src="{{ '../assets/static/image.png' | asset_url }}" does work BUT srcset="{{ '../assets/static/image.png' | asset_url }} 1x, {{ '../assets/static/image@2x.png' | asset_url }} 2x" does not work. I'm not sure why it would be different.

@loiic-v
Copy link

loiic-v commented Oct 16, 2018

src="{{ '../assets/image.png' | asset_url }}" looks problematic to me too, I tried every possibility of path (absolute, relative) or filter (asset_url, asset_img_url).
Strangest thing is that it works well with .webp format but not with .jpeg or .png

@t-kelly
Copy link
Contributor

t-kelly commented Oct 25, 2018

@t-kelly t-kelly closed this as completed Oct 25, 2018
@lock
Copy link

lock bot commented Nov 24, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Nov 24, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants