--- regenerate: true exclude_from_search: true --- {% capture cache %} {% comment %} # ----------------------------------------------------------------------------- # ~/assets/data/banner.html # Liquid procedure to generate HTML (data) for all BANNER configured for # (fragmented) AJAX load # # Product/Info: # https://jekyll.one # # Copyright (C) 2023 Juergen Adams # # J1 Theme is licensed under the MIT License. # See: https://github.com/jekyll-one-org/j1-template/blob/main/LICENSE.md # ----------------------------------------------------------------------------- # Test data: # {{ variable | debug }} # # ----------------------------------------------------------------------------- {% endcomment %} {% comment %} Liquid procedures -------------------------------------------------------------------------------- {% endcomment %} {% capture get_wave %}themes/{{site.template.name}}/procedures/blocks/get_wave.proc{% endcapture %} {% 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 global settings -------------------------------------------------------------------------------- {% endcomment %} {% assign environment = site.environment %} {% assign debug = false %} {% comment %} Process YML config data ================================================================================ {% endcomment %} {% comment %} Set config files -------------------------------------------------------------------------------- {% endcomment %} {% assign template_config = site.data.j1_config %} {% assign blocks = site.data.blocks %} {% assign banner_config_defaults = blocks.defaults.banner %} {% assign banner_config_settings = blocks.banner %} {% assign bs_config = template_config.bootstrap %} {% comment %} Set config data -------------------------------------------------------------------------------- {% endcomment %} {% assign bs_card_deck = bs_config.cards.card-deck %} {% assign banner_config_defaults = banner_config_defaults.defaults %} {% assign banner_config_settings = banner_config_settings.settings %} {% comment %} Set config options -------------------------------------------------------------------------------- {% endcomment %} {% assign parallax_options = banner_config_defaults.parallax_settings | merge: banner_config_settings.parallax_settings %} {% assign image_options = banner_config_defaults.image_settings | merge: banner_config_settings.image_settings %} {% comment %} Set HELPER variables -------------------------------------------------------------------------------- {% endcomment %} {% capture banner_config_file_name %}~/_data/blocks/banner.yml{% endcapture %} {% comment %} Detect prod mode -------------------------------------------------------------------------------- {% endcomment %} {% assign production = false %} {% if environment == 'prod' or environment == 'production' %} {% assign production = true %} {% endif %} {% comment %} Main ================================================================================ {% endcomment %} {% comment %} Main ================================================================================ {% endcomment %} {% for items in banner_config_settings %} {% assign key = items[0] %} {% assign value = items[1] %} {% assign banner_config = value %} {% for items in banner_config %} {% for banners in items %} {% if debug %} banners: {{ banners }} {% endif %} {% comment %} parse settings for MAIN keys -------------------------------------------------------------------------- {% endcomment %} {% for banner in banners %} {% assign data_type = banner | is_type %} {% if data_type == 'hash' %} {% assign banner_settings = banner %} {% assign id = banner_settings.id %} {% assign enabled = banner_settings.enabled %} {% assign badges = banner_settings.badges %} {% assign type = banner_settings.type %} {% assign icon_family = banner_settings.icon_family | downcase %} {% assign style = banner_settings.style %} {% assign raised = banner_settings.raised %} {% assign lane_span = banner_settings.lane_span %} {% assign buttons = banner_settings.buttons %} {% assign cards = banner_settings.cards %} {% assign wave_properties = banner_settings.wave %} {% assign properties = banner_settings.properties %} {% 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 %} {% comment %} generate the HTML portion for the TOP wave element ---------------------------------------------------------------------- {% endcomment %} {% if wave_properties.top.enabled %} {% include {{get_wave}} position="top" wave=wave_properties.top %} {% assign banner_wave_top = _wave %} {% endif %} {% comment %} generate the HTML portion for the BOTTOM wave element ---------------------------------------------------------------------- {% endcomment %} {% if wave_properties.bottom.enabled %} {% include {{get_wave}} position="bottom" wave=wave_properties.bottom %} {% assign banner_wave_bottom = _wave %} {% endif %} {% comment %} process current banner -------------------------------------------------------------------------- {% endcomment %} {% if banner_settings.enabled %} {% case banner_settings.type %} {% comment %} Collect DIVIDER banner ------------------------------------------------------------------------ {% endcomment %} {% when 'divider' %} {% assign banner_options = banner_config_defaults.divider | merge: banner_settings %} {% if debug %}{% endif %}
{% comment %} Reset element variables (already processed) ------------------------------------------------------------------------ {% endcomment %} {% assign banner_settings = nil %} {% comment %} Collect TEASER banner ------------------------------------------------------------------------ {% endcomment %} {% when 'teaser' %} {% assign banner_options = banner_config_defaults.teaser | merge: banner_settings %} {% if debug %}{% endif %}
{% if wave_properties.top.enabled %} {{banner_wave_top}} {% 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 == 'icon' %} {% assign icon = value %} {% endif %} {% if key == 'icon_size' %} {% assign icon_size = value %} {% endif %} {% if key == 'icon_color' %} {% assign icon_color = value %} {% endif %} {% if key == 'image_path' %} {% assign card_image_path = value %} {% endif %} {% if key == 'description_properties' %} {% assign card_properties = value %} {% endif %} {% if key == 'position' %} {% assign heading_position = value | strip_newlines%} {% endif %} {% if key == 'title' %} {% assign card_title = value | strip_newlines%} {% endif %} {% if key == 'tagline' %} {% assign card_tagline = value | strip_newlines%} {% endif %} {% if key == 'translate_description' %} {% assign card_translate_description = value %} {% endif %} {% if key == 'description' %} {% assign card_description = 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 %} {% if card_icon_color %} {% include {{select_color}} color=card_icon_color fallback="#fff" %} {% assign card_icon_color = color %} {% capture card_icon_color %}style="color:{{card_icon_color}}" %}{% endcapture %} {% else %} {% assign card_icon_color = '' %} {% endif %} {% 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 %} {% comment %} TODO: Add payment_url to config -------------------------------------------------------------------- {% endcomment %} {% assign patreon_enabled = true %} {% assign patreon_home = 'https://www.patreon.com' %} {% assign pledge_url = 'join' %} {% assign vanity = 'jekyll_one' %} {% assign pledge_button_text = 'Become a Patron' %} {% capture payment_url %}{{patreon_home}}/{{pledge_url}}/{{vanity}}{% endcapture %} {% if card_type == 'text' and card_enabled %} {% if badges %} {% endif %}
{% comment %} TODO: ----------------------------------------------------------------- ---------------------------------------------------------------- {% endcomment %} {% if heading_position == 'left' %}

{{card_title}}

{{card_tagline}}

{% endif%} {% if heading_position == 'center' %}

{{card_title}}

{{card_tagline}}

{% endif%}
{{card_description}}
{% if card_buttons %}
{% for button_hash in card_buttons %} {% include {{create_bs_button}} button_data=button_hash button_type="link" %} {{bs_button_html}} {% endfor %}
{% endif %}
{% endif %} {% endfor %} {% comment %} END cards ---------------------------------------------------------------------- {% endcomment %}
{% if wave_properties.bottom.enabled %} {{banner_wave_bottom}} {% endif %}
{% comment %} Reset element variables (already processed) ------------------------------------------------------------------------ {% endcomment %} {% assign banner_settings = nil %} {% comment %} END TEASER banner ------------------------------------------------------------------------ {% endcomment %} {% comment %} Collect IMAGE banner ------------------------------------------------------------------------ {% endcomment %} {% when 'image' %} {% comment %} Set image banner DEFAULTS gridifier: {{ gridifier | debug }} ------------------------------------------------------------------------ {% endcomment %} {% assign gridifier = image_options.gridifier %}
{% assign banner_options = banner_config_defaults.image | merge: banner_settings %} {% if debug %}{% endif %} {% capture opacity %}calc( {{banner_settings.image.opacity}}/100 ){% endcapture %} {% if banner_settings.image.justify %} {% assign background-position = 'center' %} {% else %} {% assign background-position = 'inherit' %} {% endif %}
{% comment %} Reset element variables (already processed) ------------------------------------------------------------------------ {% endcomment %} {% assign banner_settings = nil %} {% comment %} END IMAGE banner ------------------------------------------------------------------------ {% endcomment %} {% comment %} Collect PARALLAX banner ------------------------------------------------------------------------ {% endcomment %} {% when 'parallax' %}
{% assign banner_options = banner_config_defaults.parallax | merge: banner_settings %} {% if debug %}{% endif %} {% 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 == 'cite_text_size' %} {% assign card_cite_text_size = value %} {% endif %} {% if key == 'cite_text_quotes' %} {% assign card_cite_text_quotes = value %} {% endif %} {% if key == 'cite_text' %} {% assign card_text = value | strip_newlines %} {% endif %} {% if key == 'cite' %} {% assign card_cite = value | strip_newlines %} {% endif %} {% if key == 'text_color' %} {% assign card_text_color = value %} {% endif %} {% if key == 'gridify' %} {% assign card_gridify = value %} {% endif %} {% if key == 'gridifier' %} {% assign card_gridifier = value %} {% endif %} {% if key == 'darken' %} {% assign card_darken = value %} {% endif %} {% if key == 'size_y' %} {% assign card_background_size = value %} {% endif %} {% if key == 'background_image' %} {% assign card_background_image = value %} {% endif %} {% endfor %} {% endfor %} {% if card_type == 'quote' and card_enabled %} {% comment %} Set parallax DEFAULTS ------------------------------------------------------------------ {% endcomment %} {% assign background_image = parallax_options.background %} {% assign gridify = parallax_options.gridify %} {% assign gridifier = parallax_options.gridifier %} {% assign darken = parallax_options.darken %} {% comment %} Set banner VALUES ------------------------------------------------------------------ {% endcomment %} {% if card_gridify %} {% assign gridify = card_gridify %} {% endif %} {% if card_gridifier %} {% assign gridifier = card_gridifier %} {% endif %} {% if card_darken %} {% assign darken = card_darken %} {% endif %} {% if card_text_color %} {% assign text_color = card_text_color %} {% endif %} {% if card_background_size %} {% assign size_y = card_background_size %} {% endif %} {% if card_background_image %} {% assign background_image = card_background_image %} {% endif %} {% capture darken %}0.{{darken}}{% endcapture %} {% comment %} Add individual STYLE tags ------------------------------------------------------------------ {% endcomment %}
{% if card_text %}

{{card_text}}

{% endif %} {% if card_text %}{{card_cite}}{% endif %}
{% endif %} {% endfor %} {% comment %} END cards ---------------------------------------------------------------------- {% endcomment %} {% comment %} Reset element variables (already processed) ---------------------------------------------------------------------- {% endcomment %} {% assign banner_settings = nil %} {% comment %} END PARALLAX banner ---------------------------------------------------------------------- {% endcomment %} {% else %} {% comment %} Collect EXCEPTION banner: given type NOT found ---------------------------------------------------------------------- {% endcomment %} {% unless banner_settings.id == 'exception_container' %}

Banner of type {{banner_settings.type}} not found

Check your configuration at {{banner_config_file_name}}

Don't worry about this. Maybe you've a typo in the banner configuration. Check the banner config file for the unknown type.
Check for something wrong like:
id: {{banner_settings.id}}
type: {{banner_settings.type}}
comment: {{banner_settings.comment}}
{% endunless %} {% comment %} Reset element variables (already processed) -------------------------------------------------------------------------- {% endcomment %} {% assign banner_settings = nil %} {% comment %} END EXEPTION banner -------------------------------------------------------------------------- {% endcomment %} {% endcase %} {% endif %} {% comment %} endif enabled {% endcomment %} {% endfor %} {% comment %} END banners {% endcomment %} {% endfor %} {% comment %} END banner_config {% endcomment %} {% endfor %} {% comment %} END banner_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 %}