--- regenerate: true --- {% capture cache %} {% comment %} # ----------------------------------------------------------------------------- # ~/assets/data/panels.html # HTML (data) file for to generate all panel configured for (fragmented) # AJAX loads (jQuery: $.load) # # Product/Info: # 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 # # ----------------------------------------------------------------------------- # Test data: # {{variable | debug}} # # ----------------------------------------------------------------------------- {% endcomment %} {% comment %} Liquid procedures --------------------------------------------------------------- {% endcomment %} {% capture select_color %}themes/{{site.template.name}}/procedures/global/select_color.proc{% endcapture %} {% capture select_icon_size %}themes/{{site.template.name}}/procedures/global/select_icon_size.proc{% endcapture %} {% capture create_bs_button %}themes/{{site.template.name}}/procedures/global/create_bs_button.proc{% endcapture %} {% capture news_box %}themes/{{site.template.name}}/modules/footers/boxes/news_box.proc{% endcapture %} {% comment %} Liquid var initialization --------------------------------------------------------------- {% endcomment %} {% assign panel_config = site.data.modules.j1_panel.panels %} {% capture panel_config_file %}~/_data/modules/panel.yml{% endcapture %} {% comment %} Main --------------------------------------------------------------- {% endcomment %} {% for items in panel_config %} {% for panels in items %} {% for panel in panels %} {% for item in panel %} {% assign key = item[0] %} {% assign value = item[1] %} {% if key == 'id' %} {% assign id = value %} {% endif %} {% if key == 'enabled' %} {% assign enabled = value %} {% endif %} {% if key == 'type' %} {% assign type = value %} {% endif %} {% if key == 'icon_family' %} {% assign icon_family = value|downcase %} {% endif %} {% if key == 'style' %} {% assign style = value %} {% endif %} {% if key == 'raised' %} {% assign raised = value %} {% endif %} {% if key == 'lane_span' %} {% assign lane_span = value %} {% endif %} {% if key == 'title' %} {% assign title = value|strip_newlines %} {% endif %} {% if key == 'tagline' %} {% assign tagline = value|strip_newlines %} {% endif %} {% if key == 'buttons' %} {% assign buttons = value %} {% endif %} {% if key == 'cards' %} {% assign cards = value %} {% endif %} {% if key == 'boxes' %} {% assign boxes = value %} {% endif %} {% endfor %} {% endfor %} {% if raised %} {% capture card_raised %}raised-z{{raised}}{% endcapture %} {% else %} {% assign card_raised = 'raised-z3' %} {% endif %} {% if icon_family == 'fontawesome' or icon_family == 'fontawesome5' or icon_family == 'fa'%} {% assign icon_family = 'fa' %} {% elsif icon_family == 'mdi' %} {% assign icon_family = 'mdi' %} {% else'%} {% assign icon_family = 'mdi' %} {% endif %} {% assign icon_size = "5x" %} {% if lane_span == 'fixed' %} {% assign container_class = 'container j1-panel-block' %} {% elsif lane_span == 'fluid' %} {% assign container_class = 'container-fluid j1-panel-block' %} {% else %} {% assign container_class = 'container j1-panel-block' %} {% endif %} {% assign row_class = 'row j1-panel-block' %} {% if style == 'flat' %} {% assign card_style = 'card-flat' %} {% else %} {% assign card_style = '' %} {% endif %}
{% if enabled %} {% case type %} {% comment %} Collect INTRO panel ----------------------------------------------------------- {% endcomment %} {% when 'intro_panel' %}
{% assign card_items = cards | size %} {% for card in cards %} {% for items in card %} {% for item in items[1] %} {% assign key = item[0] %} {% assign value = item[1] %} {% if key == 'enabled' %} {% assign card_enabled = value %} {% endif %} {% if key == 'type' %} {% assign card_type = value %} {% endif %} {% if key == 'icon' %} {% assign card_icon = value %} {% endif %} {% if key == 'icon_size' %} {% assign card_icon_size = value %} {% endif %} {% if key == 'icon_color' %} {% assign card_icon_color = value %} {% endif %} {% if key == 'title' %} {% assign card_title = value | strip_newlines%} {% endif %} {% if key == 'tagline' %} {% assign card_tagline = value | strip_newlines%} {% endif %} {% if key == 'text' %} {% assign card_text = value | strip_newlines %} {% endif %} {% if key == 'buttons' %} {% assign card_buttons = value %} {% endif %} {% endfor %} {% if card_enabled == false %} {% assign card_items = card_items | minus:1 %} {% endif %} {% endfor %} {% assign card_width_md = 12 | divided_by: card_items %} {% if card_type == 'text' and card_enabled %}
{{card_title}}

{{card_tagline}}

{{card_text}}

{% endif %} {% endfor %} {% comment %} END cards {% endcomment %}
{% assign title = nil %} {% assign tagline = nil %} {% assign card_enabled = nil %} {% assign card_type = nil %} {% assign card_icon = nil %} {% assign icon_family = nil %} {% assign card_text = nil %} {% assign card_buttons = nil %} {% assign card_width_md = nil %} {% comment %} END INTRO panel ---------------------------------------------------------------------------- {% endcomment %} {% comment %} Collect INTRO panel - flat ---------------------------------------------------------------------------- {% endcomment %} {% when 'intro_panel_flat' %}
{% assign card_items = cards | size %} {% for card in cards %} {% for items in card %} {% for item in items[1] %} {% assign key = item[0] %} {% assign value = item[1] %} {% if key == 'enabled' %} {% assign card_enabled = value %} {% endif %} {% if key == 'type' %} {% assign card_type = value %} {% endif %} {% if key == 'icon' %} {% assign card_icon = value %} {% endif %} {% if key == 'icon_size' %} {% assign card_icon_size = value %} {% endif %} {% if key == 'icon_color' %} {% assign card_icon_color = value %} {% endif %} {% if key == 'text' %} {% assign card_text = value | strip_newlines %} {% endif %} {% if key == 'buttons' %} {% assign card_buttons = value %} {% endif %} {% endfor %} {% if card_enabled == false %} {% assign card_items = card_items | minus:1 %} {% endif %} {% endfor %} {% assign card_width_md = 12 | divided_by: card_items %} {% if card_type == 'text' and card_enabled %}
{% if card_title %}
{{card_title}}
{% endif %}

{{card_tagline}}

{{card_text}}

{% endif %} {% endfor %} {% comment %} END cards {% endcomment %}
{% assign title = nil %} {% assign tagline = nil %} {% assign card_enabled = nil %} {% assign card_type = nil %} {% assign card_icon = nil %} {% assign icon_family = nil %} {% assign card_title = nil %} {% assign card_tagline = nil %} {% assign card_text = nil %} {% assign card_buttons = nil %} {% assign card_width_md = nil %} {% comment %} END INTRO panel ---------------------------------------------------------------------------- {% endcomment %} {% comment %} Collect SERVICE panel ---------------------------------------------------------------------------- {% endcomment %} {% when 'service_panel' %}
{% assign header_available = false %} {% assign card_items = cards | size %} {% for card in cards %} {% for items in card %} {% for item in items[1] %} {% assign key = item[0] %} {% assign value = item[1] %} {% if key == 'enabled' %} {% assign card_enabled = value %} {% endif %} {% if key == 'width' %} {% assign card_width = value %} {% endif %} {% if key == 'type' %} {% assign card_type = value %} {% endif %} {% if key == 'href' %} {% assign card_href = value %} {% endif %} {% if key == 'icon' %} {% assign card_icon = value %} {% endif %} {% if key == 'icon_family' %} {% assign icon_family = value %} {% endif %} {% if key == 'icon_size' %} {% assign icon_size = value %} {% endif %} {% if key == 'icon_color' %} {% assign icon_color = value %} {% endif %} {% if key == 'text' %} {% assign card_text = value | strip_newlines %} {% endif %} {% if key == 'services' %} {% assign services = value %} {% endif %} {% endfor %} {% if card_enabled == false %} {% assign card_items = card_items | minus:1 %} {% endif %} {% endfor %} {% assign card_width_md = 12 | divided_by: card_items %} {% if card_type == "header" and card_enabled %} {% comment %} correct # items if header available {% endcomment %} {% assign card_items = card_items | minus:1 %} {% assign card_width_md = 12 | divided_by: card_items %}

{{card_title}}

{{card_tagline}}

{% endif %} {% if card_type == "service" and card_enabled %}
{{card_title}}

{{card_tagline}}

{{card_text}}

{% endif %} {% endfor %} {% comment %} END cards ------------------------------------------------------------------------ {% endcomment %}
{% assign title = nil %} {% assign tagline = nil %} {% assign card_enabled = nil %} {% assign card_type = nil %} {% assign card_icon = nil %} {% assign icon_family = nil %} {% assign card_text = nil %} {% assign services = nil %} {% assign card_width_md = nil %} {% comment %} END SERVICES panel ---------------------------------------------------------------------------- {% endcomment %} {% comment %} Collect NEWS panel ---------------------------------------------------------------------------- {% endcomment %} {% when 'news_panel' %}
{% if title %}
{% if title %} {% assign title_id = "news_panel" %} {% endif %} {% if title %}

{{title}}

{% endif %} {% if tagline %}

{{tagline}}

{% endif %}
{% endif %}
{% assign header_available = false %} {% assign box_items = boxes | size %} {% for box in boxes %} {% for items in box %} {% for item in items[1] %} {% assign key = item[0] %} {% assign value = item[1] %} {% if key == 'enabled' %} {% assign box_enabled = value %} {% endif %} {% if key == 'type' %} {% assign box_type = value %} {% endif %} {% if key == 'style' %} {% assign box_style = value %} {% endif %} {% if key == 'raised' %} {% assign box_raised = value %} {% endif %} {% if key == 'category' %} {% assign post_category = value %} {% endif %} {% if key == 'max_posts' %} {% assign posts_max = value %} {% endif %} {% if key == 'buttons' %} {% assign box_buttons = value %} {% endif %} {% endfor %} {% if box_enabled == false %} {% assign box_items = box_items | minus:1 %} {% endif %} {% endfor %} {% comment %} calculate columns ------------------------------------------------------------------ {% endcomment %} {% assign box_width = 12 | divided_by: box_items %} {% if box_type == "last_current" and box_enabled %}
{% assign last_post_written = false %} {% for post in site.posts %} {% for category in post.categories %} {% if category == post_category and last_post_written != true %} {% if post.image %} {% assign image_name = post.image.name %} {% assign image_path = post.image.path %} {% if post.image.random %} {% assign max_random = image_name | regex_replace: '[a-zA-Z_-]*' %} {% assign max_random = max_random | regex_replace: '\.' %} {% assign random = max_random | rand %} {% assign image_name = image_name | regex_replace: '\d+', random %} {% endif %} {% capture image %}{{image_path}}/{{image_name}}{% endcapture %} {% else %} {% assign image = 'false' %} {% endif %} {% assign icon = 'comment-alt' %} {% assign icon_family = 'zmdi' %} {% assign icon_color = '#3F51B5' %} {% assign icon_size = 'large' %} {% if post.icon %} {% assign icon = post.icon.name | downcase %} {% assign icon_family = post.icon.family %} {% assign icon_color = post.icon.color %} {% assign icon_size = post.icon.size %} {% if icon_family == "FontAwesome" %} {% assign icon_family = "fa" %} {% elsif icon_family == "Glyphicon" %} {% assign icon_family = "glyphicon" %} {% elsif icon_family == "MDI" %} {% assign icon_family = "mdi" %} {% elsif icon_family == "ZMDI" %} {% assign icon_family = "zmdi" %} {% endif %} {% endif %} {% include {{select_icon_size}} family=icon_family size="xxxlarge" %} {% assign icon_size = size %} {% include {{select_color}} color=icon_color fallback="#000"%} {% assign icon_color = color %} {% if icon != 'false' and image == 'false' %} {% endif %} {% if icon == 'false' and image == 'false' %} {% endif %} {% if image != 'false' %}
{{post.title}}

{{post.title}}

{{post.tagline}}

{{post.excerpt}}

{% endif %} {% assign last_post_written = true %} {% assign last_post_title = post.title %} {% break%} {% endif %} {% endfor %} {% endfor %}
{% endif %} {% if box_type == "recent" and box_enabled %}
{% assign max_posts = posts_max | minus:'1' %} {% assign posts_written = 0 %} {% assign last_post_written = false %} {% for post in site.posts %} {% for category in post.categories %} {% if category == post_category and last_post_written != true %}
{% if post.title == last_post_title %} {% continue %} {% endif %} {% assign posts_written = posts_written | plus:'1' %} {% if posts_written == posts_max %} {% assign last_post_written = true %} {% break %}{% endif %}

{{post.title}}

{{post.tagline}}

{{post.excerpt | truncatewords: 20}}

{% endif %} {% endfor %} {% endfor %}
{% endif %} {% endfor %}
{% comment %} END boxes ---------------------------------------------------------------------- {% endcomment %}
{% assign box_enabled = nil %} {% assign box_type = nil %} {% assign box_icon = nil %} {% assign box_icon_color = nil %} {% assign box_icon_size = nil %} {% assign box_image_path = nil %} {% assign box_animate = nil %} {% assign box_title = nil %} {% assign box_tagline = nil %} {% assign box_text = nil %} {% assign box_buttons = nil %} {% assign box_category = nil %} {% assign box_max_posts = nil %} {% comment %} END NEWS panel ----------------------------------------------------------- {% endcomment %} {% else %} {% comment %} Exception: no panel of given type found --------------------------------------------------------- {% endcomment %}

Panel {{type}} not found

Check your configuration

Don't worry about this. May you've a typo in the panel's configuration. Check the panel config file for the unknown type. A line contains something wrong like 'type: {{type}}'. Have a look at:
{{panel_config_file}}
{% endcase %} {% endif %} {% comment %} endif enabled ----------------------------------------------------------- {% endcomment %} {% endfor %} {% endfor %} {% endcapture %} {{cache | strip_empty_lines}} {% assign cache = nil %}