--- regenerate: true --- {% capture cache %} {% comment %} # ----------------------------------------------------------------------------- # ~/assets/data/sidebar.html # Liquid PROCEDURE template to create the HTML portion of the sidebar # NOTE: Loaded dynamically by J1 NAV Manager module (AJAX) # # 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: # liquid_var: {{ liquid_var | 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 %} {% comment %} Liquid var initialization -------------------------------------------------------------------------------- {% endcomment %} {% comment %} Set global settings ------------------------------------------------------------------------------ {% endcomment %} {% assign nav_id = "navigator_nav" %} {% assign nav_expand = "lg" %} {% comment %} Set config files ------------------------------------------------------------------------------ {% endcomment %} {% assign navigator_config = site.data.modules.j1_navigator %} {% assign nav_defaults = navigator_config.defaults %} {% assign nav_bar_defaults = nav_defaults.nav_bar %} {% assign nav_bar_config = navigator_config.nav_bar %} {% assign nav_sidebar_default = nav_defaults.nav_sidebar %} {% assign nav_sidebar_config = navigator_config.nav_sidebar %} {% comment %} Set config files ------------------------------------------------------------------------------ {% endcomment %} {% assign navigator_config = site.data.modules.j1_navigator %} {% assign sidebar_config = navigator_config.nav_sidebar %} {% assign theme_switcher = site.data.modules.j1_theme_switcher %} {% comment %} Set config options ------------------------------------------------------------------------------ {% endcomment %} {% assign nav_bar_options = nav_bar_defaults | merge: nav_bar_config %} {% assign sidebar_options = nav_sidebar_default | merge: nav_sidebar_config %} {% comment %} Set sidebar properties ------------------------------------------------------------------------------ {% endcomment %} {% assign display_user_info = sidebar_options.display_user_info %} {% assign display_theme = sidebar_options.display_theme %} {% assign close_icon = sidebar_options.close_icon %} {% comment %} Main ------------------------------------------------------------------------------ {% endcomment %} {% if sidebar_options.icon_family == 'FontAwesome' or sidebar_options.icon_family == 'FontAwesome4' or sidebar_options.icon_family == 'FontAwesome5' %} {% assign icon_family = 'fa' %} {% elsif sidebar_options.icon_family == 'MDI' or sidebar_options.icon_family == 'Material Design Icons'%} {% assign icon_family = 'mdi' %} {% else %} {% assign icon_family = 'mdi' %} {% endif %} {% include {{select_color}} color=sidebar_options.icon_color fallback="#9E9E9E" %} {% capture icon_color %}style="color: {{color}}"{% endcapture %} {% include {{select_icon_size}} family=icon_family size=sidebar_options.icon_size %} {% assign icon_size = size %} {% comment %} Main -------------------------------------------------------------------------------- {% endcomment %} {% for boxes in sidebar_config.boxes %} {% for box in boxes %} {% for item in box[1] %} {% assign key = item[0] %} {% assign value = item[1] %} {% if key == 'enabled' %} {% assign enabled = value %} {% endif %} {% if key == 'type' %} {% assign type = value %} {% endif %} {% if key == 'title' %} {% assign title = value %} {% endif %} {% if key == 'type' %} {% assign type = value %} {% endif %} {% if key == 'links' %} {% assign links = value %} {% endif %} {% endfor %} {% if enabled %} {% case type %} {% comment %} Collect USER info ---------------------------------------------------------------------- {% endcomment %} {% when 'user_info' %}
{% comment %} END Collect USER info ---------------------------------------------------------------------- {% endcomment %} {% comment %} Reset element variables ---------------------------------------------------------------------- {% endcomment %} {% assign enabled = nil %} {% assign type = nil %} {% assign title = nil %} {% assign type = nil %} {% assign links = nil %} {% comment %} Collect THEME info ---------------------------------------------------------------------- {% endcomment %} {% when 'theme_info' %} {% comment %} END Collect THEME info ---------------------------------------------------------------------- {% endcomment %} {% comment %} Reset element variables ---------------------------------------------------------------------- {% endcomment %} {% assign enabled = nil %} {% assign type = nil %} {% assign title = nil %} {% assign type = nil %} {% assign links = nil %} {% comment %} Collect SITE info ---------------------------------------------------------------------- {% endcomment %} {% when 'site_info' %} {% comment %} END Collect SITE info ---------------------------------------------------------------------- {% endcomment %} {% comment %} Reset element variables ---------------------------------------------------------------------- {% endcomment %} {% assign enabled = nil %} {% assign type = nil %} {% assign title = nil %} {% assign type = nil %} {% assign links = nil %} {% endcase %} {% endif %} {% endfor %} {% endfor %} {% endcapture %} {{ cache | strip_empty_lines }} {% assign cache = nil %}