--- regenerate: true --- {% capture cache %} {% comment %} # ----------------------------------------------------------------------------- # ~/assets/data/panel.html # Liquid procedure to generate HTML (data) for all panel configured for # (fragmented) AJAX load # # Product/Info: # https://jekyll.one # # Copyright (C) 2020 Juergen Adams # # J1 Template is licensed under the MIT License. # See: https://github.com/jekyll-one-org/J1 Template/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 %} Set config files -------------------------------------------------------------------------------- {% endcomment %} {% comment %} Set global settings -------------------------------------------------------------------------------- {% endcomment %} {% assign environment = site.environment %} {% assign debug = false %} {% comment %} Process YML config data ================================================================================ {% endcomment %} {% comment %} Set config files -------------------------------------------------------------------------------- {% endcomment %} {% assign panel_config_defaults = site.data.blocks.defaults.panel %} {% assign panel_config_settings = site.data.blocks.panel %} {% comment %} Set config data -------------------------------------------------------------------------------- {% endcomment %} {% assign panel_config_defaults = panel_config_defaults.defaults %} {% assign panel_config_settings = panel_config_settings.settings %} {% comment %} Set HELPER variables -------------------------------------------------------------------------------- {% endcomment %} {% capture panel_config_file_name %}~/_data/modules/panel.yml{% endcapture %} {% assign production = false %} {% if environment == 'prod' or environment == 'production' %} {% assign production = true %} {% endif %} {% comment %} Main ================================================================================ {% endcomment %} {% for items in panel_config_settings %} {% assign key = items[0] %} {% assign value = items[1] %} {% assign panel_config = value %} {% for items in panel_config %} {% for panels in items %} {% if debug %} panels: {{ panels }} {% endif %} {% comment %} parse settings for MAIN keys -------------------------------------------------------------------------- {% endcomment %} {% for panel in panels %} {% assign data_type = panel | is_type %} {% if data_type == 'hash' %} {% assign panel_settings = panel %} {% assign id = panel_settings.id %} {% assign enabled = panel_settings.enabled %} {% assign type = panel_settings.type %} {% assign icon_family = panel_settings.icon_family | downcase %} {% assign style = panel_settings.style %} {% assign raised = panel_settings.raised %} {% assign lane_span = panel_settings.lane_span %} {% assign title = panel_settings.title|strip_newlines %} {% assign tagline = panel_settings.tagline|strip_newlines %} {% assign buttons = panel_settings.buttons %} {% assign header = panel_settings.header %} {% assign helper_classes = panel_settings.helper_classes %} {% assign cards = panel_settings.cards %} {% endif %} {% endfor %} {% if lane_span == 'fixed' %} {% assign container_class = 'container' %} {% elsif lane_span == 'fluid' %} {% assign container_class = 'container-fluid' %} {% else %} {% assign container_class = 'container' %} {% endif %} {% assign row_class = 'row' %} {% if style == 'flat' %} {% assign card_style = 'card-flat' %} {% else %} {% assign card_style = '' %} {% endif %} {% 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' %} {% elsif icon_family == 'iconify' %} {% assign icon_family = 'iconify' %} {% else'%} {% assign icon_family = 'mdi' %} {% endif %} {% comment %} process current panel -------------------------------------------------------------------------- {% endcomment %} {% if panel_settings.enabled %} {% case panel_settings.type %} {% comment %} Collect INTRO panel ------------------------------------------------------------------------ {% endcomment %} {% when 'intro' %} {% assign panel_options = panel_config_defaults.intro | merge: panel_settings %} {% if debug %}{% endif %}

{{panel_settings.title}}

{{panel_settings.tagline}}

{{panel_settings.description}}
{% 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_family' %} {% assign card_icon_family = value | downcase %} {% 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 %} {% include {{select_icon_size}} family=icon_family size=icon_size %} {% assign icon_size = size %} {% if card_width %} {% assign card_enabled = true %} {% assign card_width_md = card_width %} {% else %} {% assign card_width_md = 12|divided_by: card_items %} {% endif %} {% if card_animate %} {% assign card_animate = card_animate %} {% else %} {% assign card_animate = '' %} {% endif %} {% comment %} extract link for card icon ------------------------------------------------------------------ {% endcomment %} {% for items in card_buttons %} {% for item in items %} {% if item[0] == 'button' %} {% for elm in item[1] %} {% assign key = elm[0] %} {% assign value = elm[1] %} {% if key == 'href' %} {% assign card_href = value %} {% endif %} {% endfor %} {% endif %} {% endfor %} {% endfor %} {% comment %} TODO: Style should be configurable ------------------------------------------------------------------ {% endcomment %} {% assign card_style = 'flat' %} {% if card_type == 'text' and card_enabled and card_style == 'flat' %} {% assign card_raised = 'raised-z5' %}
{% if card_icon_family == 'iconify' %} {% if card_icon_color == 'bg-primary' %} {% else %} {% endif %} {% else %} {% if card_icon_color == 'bg-primary' %} {% else %} {% endif %} {% endif %}

{{card_title}}

{{card_text}}
{% endif %}
{% endfor %} {% comment %} END cards ------------------------------------------------------------------ {% endcomment %}
{% comment %} Reset element variables (already processed) ------------------------------------------------------------------------ {% endcomment %} {% assign panel_settings = nil %} {% comment %} Collect SERVICE panel ------------------------------------------------------------------------ {% endcomment %} {% when 'service' %} {% if debug %}{% endif %} {% if debug %}{% endif %} {% assign panel_options = panel_config_defaults.service | merge: panel_settings %} {% if debug %}{% endif %}
{% if panel_settings.header.enabled %}

{{panel_settings.header.title}}

{{panel_settings.header.tagline}}

{{panel_settings.header.description}}

{% endif %}
{% 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 == '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 == '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 == "service" and card_enabled %}
{{card_title}}

{{card_tagline}}

{{card_text}}

{% endif %} {% endfor %} {% comment %} END cards -------------------------------------------------------------------- {% endcomment %}
{% comment %} Reset element variables (already processed) ------------------------------------------------------------------------ {% endcomment %} {% assign panel_settings = nil %} {% comment %} END SERVICES panel ------------------------------------------------------------------------ {% endcomment %} {% comment %} Collect NEWS panel ------------------------------------------------------------------------ {% endcomment %} {% when 'news' %} {% assign panel_options = panel_config_defaults.news|merge: panel_settings %} {% if debug %}{% endif %}
{% if panel_options.title %}

{{panel_options.title}}

{{panel_options.tagline}}

{{panel_options.description}}

{% endif %} {% assign header_available = false %} {% assign card_items = panel_options.cards|size %} {% for card in panel_options.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 == 'style' %} {% assign card_style = value %} {% endif %} {% if key == 'raised' %} {% assign card_raised = value %} {% endif %} {% if key == 'category' %} {% assign post_category = value %} {% endif %} {% if key == 'max_posts' %} {% assign posts_max = value %} {% endif %} {% if key == 'readmore_text' %} {% assign readmore_text = value %} {% endif %} {% if key == 'truncatewords' %} {% assign truncatewords = value %} {% endif %} {% if key == 'buttons' %} {% assign card_buttons = value %} {% endif %} {% endfor %} {% if card_enabled == false %} {% assign card_items = card_items|minus:1 %} {% endif %} {% endfor %} {% assign posts_written = 0 %} {% assign last_post_written = false %} {% assign card_width = 12|divided_by: posts_max %}
{% for post in site.posts %} {% for category in post.categories %} {% if posts_written == posts_max %} {% assign last_post_written = true %} {% break %}{% endif %} {% if category == post_category and last_post_written != true %} {% assign posts_written = posts_written|plus:1 %} {% if posts_written != posts_max %}
{% else %}
{% endif %}
{% if post.image %} {{post.title}} {% assign post_width = '80x' %} {% else %} {% assign post_width = '100x' %} {% endif %}

{{post.title}}

{{post.excerpt|truncatewords:50|replace:'...',' ...'|remove:'
'|remove:'
'|remove:'

'|remove:'

'}}
{{post.date|date:"%Y %B, %e"}}
{% endif %} {% endfor %} {% endfor %}
{% endfor %}
{% comment %} Reset element variables (already processed) ------------------------------------------------------------------------ {% endcomment %} {% assign panel_settings = nil %} {% comment %} END NEWS panel ------------------------------------------------------------------------ {% endcomment %} {% else %} {% comment %} Collect EXCEPTION panel: given type NOT found ------------------------------------------------------------------------ {% endcomment %} {% unless panel_settings.id == 'exception_container' %}

panel of type {{panel_settings.type}} not found

Check your configuration at {{panel_config_file_name}}

Don't worry about this. Maybe you've a typo in the panel configuration. Check the panel config file for the unknown type.
Check for something wrong like:
id: {{panel_settings.id}}
type: {{panel_settings.type}}
comment: {{panel_settings.comment}}
{% endunless %} {% comment %} Reset element variables (already processed) ------------------------------------------------------------------------ {% endcomment %} {% assign panel_settings = nil %} {% comment %} END EXEPTION panel ------------------------------------------------------------------------ {% endcomment %} {% endcase %} {% endif %} {% comment %} endif enabled {% endcomment %} {% endfor %} {% comment %} END panels {% endcomment %} {% endfor %} {% comment %} END panel_config {% endcomment %} {% endfor %} {% comment %} END panel_config_settings {% endcomment %} {% endcapture %} {% if production %} {% capture _LINE_FEED %}{% endcapture %}{% if site.compress_html.ignore.envs contains jekyll.environment %}{{ cache | strip_html_comments }}{% else %}{% capture _content %}{{ cache | strip_html_comments }}{% endcapture %}{% assign _profile = site.compress_html.profile %}{% if site.compress_html.endings == "all" %}{% assign _endings = "html head body li dt dd p rt rp optgroup option colgroup caption thead tbody tfoot tr td th" | split: " " %}{% else %}{% assign _endings = site.compress_html.endings %}{% endif %}{% for _element in _endings %}{% capture _end %}{% endcapture %}{% assign _content = _content | remove: _end %}{% endfor %}{% if _profile and _endings %}{% assign _profile_endings = _content | size | plus: 1 %}{% endif %}{% for _element in site.compress_html.startings %}{% capture _start %}<{{ _element }}>{% endcapture %}{% assign _content = _content | remove: _start %}{% endfor %}{% if _profile and site.compress_html.startings %}{% assign _profile_startings = _content | size | plus: 1 %}{% endif %}{% if site.compress_html.comments == "all" %}{% assign _comments = "" | split: " " %}{% else %}{% assign _comments = site.compress_html.comments %}{% endif %}{% if _comments.size == 2 %}{% capture _comment_befores %}.{{ _content }}{% endcapture %}{% assign _comment_befores = _comment_befores | split: _comments.first %}{% for _comment_before in _comment_befores %}{% if forloop.first %}{% continue %}{% endif %}{% capture _comment_outside %}{% if _carry %}{{ _comments.first }}{% endif %}{{ _comment_before }}{% endcapture %}{% capture _comment %}{% unless _carry %}{{ _comments.first }}{% endunless %}{{ _comment_outside | split: _comments.last | first }}{% if _comment_outside contains _comments.last %}{{ _comments.last }}{% assign _carry = false %}{% else %}{% assign _carry = true %}{% endif %}{% endcapture %}{% assign _content = _content | remove_first: _comment %}{% endfor %}{% if _profile %}{% assign _profile_comments = _content | size | plus: 1 %}{% endif %}{% endif %}{% assign _pre_befores = _content | split: "" %}{% assign _pres_after = "" %}{% if _pres.size != 0 %}{% if site.compress_html.blanklines %}{% assign _lines = _pres.last | split: _LINE_FEED %}{% capture _pres_after %}{% for _line in _lines %}{% assign _trimmed = _line | split: " " | join: " " %}{% if _trimmed != empty or forloop.last %}{% unless forloop.first %}{{ _LINE_FEED }}{% endunless %}{{ _line }}{% endif %}{% endfor %}{% endcapture %}{% else %}{% assign _pres_after = _pres.last | split: " " | join: " " %}{% endif %}{% endif %}{% capture _content %}{{ _content }}{% if _pre_before contains "" %}{% endif %}{% unless _pre_before contains "" and _pres.size == 1 %}{{ _pres_after }}{% endunless %}{% endcapture %}{% endfor %}{% if _profile %}{% assign _profile_collapse = _content | size | plus: 1 %}{% endif %}{% if site.compress_html.clippings == "all" %}{% assign _clippings = "html head title base link meta style body article section nav aside h1 h2 h3 h4 h5 h6 hgroup header footer address p hr blockquote ol ul li dl dt dd figure figcaption main div table caption colgroup col tbody thead tfoot tr td th" | split: " " %}{% else %}{% assign _clippings = site.compress_html.clippings %}{% endif %}{% for _element in _clippings %}{% assign _edges = " ;; ;" | replace: "e", _element | split: ";" %}{% assign _content = _content | replace: _edges[0], _edges[1] | replace: _edges[2], _edges[3] | replace: _edges[4], _edges[5] %}{% endfor %}{% if _profile and _clippings %}{% assign _profile_clippings = _content | size | plus: 1 %}{% endif %}{{ _content }}{% if _profile %}
Step Bytes
raw {{ cache | strip_html_comments | size }}{% if _profile_endings %}
endings {{ _profile_endings }}{% endif %}{% if _profile_startings %}
startings {{ _profile_startings }}{% endif %}{% if _profile_comments %}
comments {{ _profile_comments }}{% endif %}{% if _profile_collapse %}
collapse {{ _profile_collapse }}{% endif %}{% if _profile_clippings %}
clippings {{ _profile_clippings }}{% endif %}
{% endif %}{% endif %} {% else %} {{ cache | pretty_print | remove:'' | remove:'' | strip_empty_lines }} {% endif %} {% assign cache = nil %}