--- regenerate: true exclude_from_search: 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) 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 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 template_config = site.data.j1_config %} {% assign blocks = site.data.blocks %} {% assign panel_config_defaults = blocks.defaults.panel %} {% assign panel_config_settings = blocks.panel %} {% assign bs_config = template_config.bootstrap %} {% comment %} Set config data -------------------------------------------------------------------------------- {% endcomment %} {% assign panel_config_defaults = panel_config_defaults.defaults %} {% assign panel_config_settings = panel_config_settings.settings %} {% assign bs_card_deck = bs_config.cards.card_deck %} {% comment %} Set config options -------------------------------------------------------------------------------- {% endcomment %} {% assign panel_config_options = panel_config_defaults | merge: panel_config_settings %} {% comment %} Variables -------------------------------------------------------------------------------- {% endcomment %} {% assign truncate_words = site.excerpt_truncate_words %} {% assign category_blacklist = template_config.posts.category_blacklist %} {% comment %} Set HELPER variables (used by exception panel) -------------------------------------------------------------------------------- {% endcomment %} {% capture panel_config_file_name %}~/_data/blocks/panel.yml{% endcapture %} {% comment %} Collect CSS image filters -------------------------------------------------------------------------------- {% endcomment %} {% if panel_config_options.filters %} {% for filter in panel_config_options.filters %} {% capture css_filters %}{{css_filters}} {{filter[0]}}({{filter[1]}}){% endcapture %} {% endfor %} {% capture image_filters %}filter:{{css_filters}}{% endcapture %} {% else %} {% assign image_filters = '' %} {% endif %} {% comment %} language detection|i18n -------------------------------------------------------------------------------- {% endcomment %} {% if site.language == "en" %} {% assign language = "en" %} {% elsif site.language == "de"%} {% assign language = "de" %} {% else %} {% assign language = "en" %} {% endif %} {% if language == "en" %} {% assign readmore_text = "read" %} {% assign infinite_scroll_last = "More articles can be found with the" %} {% endif %} {% if language == "de" %} {% assign readmore_text = "lesen" %} {% assign infinite_scroll_last = "Weitere Artikel finden Sie im" %} {% endif %} {% comment %} Detect prod mode -------------------------------------------------------------------------------- {% endcomment %} {% 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 properties = panel_settings.properties %} {% assign description_properties = panel_settings.description_properties %} {% assign cards = panel_settings.cards %} {% assign wave_properties = panel_settings.wave %} {% 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 %} 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 panel_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 panel_wave_bottom = _wave %} {% 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 %} {% assign debug = true %} {% if debug %}{% endif %}{{panel_settings.tagline}}
{{panel_settings.tagline}}