No commit activity in last 3 years
No release in over 3 years
Jekyll content_for and yield tags with conditional rendering and in-line filters
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

 Project Readme

Octopress Content For

Add content_for and yield tags to Jekyll with conditional rendering and in-line filters.

Build Status Gem Version License

Installation

If you're using bundler add this gem to your site's Gemfile in the :jekyll_plugins group:

group :jekyll_plugins do
  gem 'octopress-content-for'
end

Then install the gem with Bundler

$ bundle

To install manually without bundler:

$ gem install octopress-content-for

Then add the gem to your Jekyll configuration.

gems:
  -octopress-content-for

Usage

Use it like a typical content_for tag.

{% content_for awesome_content %}
some content
{% endcontent_for %}

{% yield awesome_content %}  //=> some content

Use in-line filters.

{% yield awesome_content | upcase %}  //=> SOME CONTENT

Use conditional rendering in both content_for and yield tags.

{% content_for footer unless page.footer == false %}
Footer!
{% endcontent_for %}

{% yield footer if page.footer %}

Contributing

  1. Fork it ( https://github.com/octopress/content-for/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request