Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

img label do not work well #1426

Closed
noodlefighter opened this issue Aug 2, 2015 · 6 comments
Closed

img label do not work well #1426

noodlefighter opened this issue Aug 2, 2015 · 6 comments

Comments

@noodlefighter
Copy link

file/_post/test.md,/_post/test/test.gif
I need to show image with width=100.
like:{% img /test/test.gif 100 %}

THEN i try to use relative path...

{% img test.gif 100 %}
{% img \test.gif 100 %}

![image](test.gif)
![image](\test.gif)

{% img {% asset_path test.gif %} 100 %}

but..
generated:

<a href="null"><img class="test.gif 100"></a>
<a href="null"><img class="\test.gif 100"></a>
<p><a href="test.gif"><img src="test.gif" alt="image"></a><br><a href="\test.gif"><img src="\test.gif" alt="image"></a></p>
<a href="null"><img class="{% asset_path test.gif"></a> 100 %}
@ghost
Copy link

ghost commented Aug 2, 2015

![img] (/imgpath/img.gif)

@Xuanwo
Copy link
Contributor

Xuanwo commented Aug 2, 2015

your can insert it with html

@leesei
Copy link
Member

leesei commented Aug 4, 2015

Does @mrSummerSun's code fix the issue?

@noodlefighter
Copy link
Author

@mrSummerSun @leesei
i think it is a bug.
{% img \test.gif 100 %} should be equivalent to {% img /test/test.gif 100 %}

the ouput like <a href="null"><img class="\test.gif 100"></a>is certainly something wrong.

@leesei
Copy link
Member

leesei commented Aug 4, 2015

Are you aware that \ is different from / in URL?
Are you using post_asset_folder?

Here's how I work with asset without using post_asset_folder:

  • create a folder asset/ in source
  • use {% img /asset/test.jpg %} or ![image](/asset/test.jpg) to embed the image

Also note that tags cannot be nested, {% img {% asset_path test.gif %} 100 %} will never work.

@leesei
Copy link
Member

leesei commented Aug 14, 2015

Please open new issue if the problem persists with latest build.

@leesei leesei closed this as completed Aug 14, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants