-
Notifications
You must be signed in to change notification settings - Fork 48
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
Would it be possible to use the standard Markdown syntax for images? #15
Comments
You should be able to achieve this by writing a simple converter plugin. This should do the trick, though I don't know how performant it will be with larger sites: module Jekyll
class UpcaseConverter < Converter
safe true
priority :low
def matches(ext)
ext =~ /^\.md$/i
end
def output_ext(ext)
".html"
end
def convert(content)
content.gsub(/\!\[(.+)\]\((.+)\)/, '{% responsive_image path: \2 alt: \1 %}')
end
end
end |
Shouldn't the output be How does this ensure it is run before Kramdown? |
If you're seeing it run after the Markdown processor, then you can bump the |
Thanks for the explanation. It seems I could also build my converter so that it runs Kramdown after it has done its job: http://stackoverflow.com/a/26075361/717195 |
I think I will use @parkr 's solution: http://stackoverflow.com/a/35636071/717195 But then I still need #13 before migrating from my current use of https://github.com/nhoizey/jekyll-picture-tag … |
I have put the question on StackOverflow first, so this is almost a copy/paste:
I would like to use the Jekyll Responsive Image plugin to generate appropriate responsive images with
srcset
/sizes
attributes for my posts' images. That's why I'm here obviously… ;-)But I would also like to be able to edit my posts in a software providing a live preview like MacDown, which only understands the standard Markdown syntax for images.
That's why I would like to know if there is a way —in this plugin or another one— to tell Jekyll to transform the standard Markdown syntax for images, which I would put in my Markdown files…
![alt text](path/to/image.jpg)
…into this syntax specific to the Jekyll Responsive Image plugin:
{% responsive_image path: path/to/image.jpg alt: "alt text" %}
And THEN, Jekyll could continue and use Kramdown to generate the HTML…
I understand I could only manage one template this way, but it should be enough for my blog.
The text was updated successfully, but these errors were encountered: