Jekyll Markdown Block
Why? Because you should be able to:
- Write markdown anywhere.
- {% include %} markdown files anywhere.
Installation
Add this line to your application's Gemfile under the :jekyll_plugins group:
group :jekyll_plugins do
gem 'jekyll-markdown-block'
end
And then execute:
$ bundle
Next add this to your plugins folder to automatically load any Jekyll plugins in your :jekyll_plugins group.
# in _plugins/bundler.rb
require "bundler/setup"
Bundler.require(:jekyll_plugins)
Or you can just add a ruby file to your Jekyll plugins directory with the line require "jekyll-markdown-block"
Usage
Embed Markdown in HTML
Drop some markdown in your html, and it will render nicely
<!-- Some random HTML file-->
<div>
{% markdown %}
## That's right folks!
Markdown in your `HTML`!
- Any template
- Any time
{% endmarkdown %}
</div>
Convert includes with markdown
Correctly render markdown files which are included in an HTML page.
<!-- Another random HTML file-->
<div>
{% markdown %}{% include coolcat.md %}{% endmarkdown %}
</div>
That's pretty much it. Have fun!
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request