fridge-cms / jekyll-fridge

Jekyll helper for adding Fridge content to your Jekyll site.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

jekyll-fridge

Jekyll helper for adding Fridge content to your Jekyll site.

Installation

  • Add jekyll-fridge to your Gemfile:
group :jekyll_plugins do
  gem "jekyll-fridge"
end
  • Read on to configure the plugin.

Not using Bundler? There are other ways..

Usage

In _config.yml

fridge:
  client_id: sk_xxxxxxxxxx
  client_secret: xxxxxxxxxxxx

In your templates

<h1>{{site.fridge.settings.home.title}}</h1>

<nav>
  {% for item in site.fridge.navigation.content %}
    <li>{{item.title}}</li>
  {% endfor %}
</nav>

{{site.fridge.content.15.body | markdownify }}

{% for posts in site.fridge.content.blog_post %}
  <li>Post: {{post.title}}</li>
{% endfor %}

Using Jekyll filters

{% assign firefoxes = site.fridge.browser.content | where:"title", "Firefox" %}
{% for browser in firefoxes %}
  <li>{{browser.title}}</li>
{% endfor %}

{% assign pages = site.fridge.content.page | sort:"title" %}
{% for page in pages %}
  <li>{{page.title}}</li>
{% endfor %}

Filters

fridge_asset

Finds Fridge asset based on file name. Downloads asset to asset_dir (configurable. defaults to assets) and returns a url for the file.

{% for image in site.fridge.content.photo %}
  <img src="{{ image.name | fridge_asset }}" />
{% endfor %}

fridge_choices

Parses choices from a select/radio/checkbox content type.

{% assign choices = site.fridge.types.blog.categories.choices %}
{% for category in choices %}
  {{category}}
{% endfor %}

Reference

About

Jekyll helper for adding Fridge content to your Jekyll site.

License:MIT License


Languages

Language:Ruby 100.0%