Sha256: 86dee3de5fe23d72e158e78a5e5132a7713137af09686d7bc9de8381a591263e

Contents?: true

Size: 1.91 KB

Versions: 27

Compression:

Stored size: 1.91 KB

Contents

{% comment %}
 # -----------------------------------------------------------------------------
 #   ~/_includes/themes/j1/procedures/components/get_category.proc
 #  Liquid PROCEDURE to get the font icon for a given category
 #
 #  https://jekyll-one.com
 #
 #  Copyright (C) 2019 Juergen Adams
 #
 #  J1 Template is licensed under the MIT License.
 #  See: https://github.com/jekyll-one/j1_template_mde/blob/master/LICENSE
 #
 # -----------------------------------------------------------------------------
 #   Global procedure. Read RGB category values from j1_categorys.yml and returns
 #   the category found with liquid var category
 #
 #    Usage:
 #      1)  assign the 'category' variable to a category name. If the category (name)
 #          couldn't be found, the category given with fallback is returned.
 #      2)  include the get_category.proc procedure
 #
 #  Example:
 #
 #  {% capture get_category %}themes/{{site.template.name}}/procedures/global/get_category.proc{% endcapture %}
 #
 #  {% include {{get_category}} post=my_post %}
 #  {% assign my_category = {{_category}} %}
 #
 # -----------------------------------------------------------------------------
 # Test data:
 #  {{ liquid_var | debug }}
 #  category:  {{ item[0] }}: {{ item[1] }}
 # -----------------------------------------------------------------------------
{% endcomment %}

{% comment %} Variables
   ------------------------------------------------------------ {% endcomment %}

{% assign _categories = include.post.categories %}
{% assign _category   = nil %}


{% comment %} Liquid procedures
   ------------------------------------------------------------ {% endcomment %}


{% comment %} Main
   ------------------------------------------------------------ {% endcomment %}

  {% for item in _categories %}
    {% if item == "posts"  %}
      {% continue %}
    {% else %}
      {% assign _category = item %}
      {% break %}
    {% endif %}
  {% endfor %}



Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
j1_template_mde-2018.4.36 _includes/themes/j1/procedures/global/get_category.proc
j1_template_mde-2018.4.35 _includes/themes/j1/procedures/global/get_category.proc
j1_template_mde-2018.4.34 _includes/themes/j1/procedures/global/get_category.proc
j1_template_mde-2018.4.33 _includes/themes/j1/procedures/global/get_category.proc
j1_template_mde-2018.4.32 _includes/themes/j1/procedures/global/get_category.proc
j1_template_mde-2018.4.31 _includes/themes/j1/procedures/global/get_category.proc
j1_template_mde-2018.4.30 _includes/themes/j1/procedures/global/get_category.proc
j1_template_mde-2018.4.29 _includes/themes/j1/procedures/global/get_category.proc
j1_template_mde-2018.4.28 _includes/themes/j1/procedures/global/get_category.proc
j1_template_mde-2018.4.27 _includes/themes/j1/procedures/global/get_category.proc
j1_template_mde-2018.4.26 _includes/themes/j1/procedures/global/get_category.proc
j1_template_mde-2018.4.25 _includes/themes/j1/procedures/global/get_category.proc
j1_template_mde-2018.4.24 _includes/themes/j1/procedures/global/get_category.proc
j1_template_mde-2018.4.23 _includes/themes/j1/procedures/global/get_category.proc
j1_template_mde-2018.4.22 _includes/themes/j1/procedures/global/get_category.proc
j1_template_mde-2018.4.21 _includes/themes/j1/procedures/global/get_category.proc
j1_template_mde-2018.4.20 _includes/themes/j1/procedures/global/get_category.proc
j1_template_mde-2018.4.19 _includes/themes/j1/procedures/global/get_category.proc
j1_template_mde-2018.4.18 _includes/themes/j1/procedures/global/get_category.proc
j1_template_mde-2018.4.17 _includes/themes/j1/procedures/global/get_category.proc