{% comment %} # ----------------------------------------------------------------------------- # ~/_includes/templates/j1/modules/navigator/procedures/topsearch.proc # Liquid PROCEDURE template to create search input for the quicklinks bar # # Product/Info: # https://jekyll.one # # Copyright (C) 2022 Juergen Adams # # J1 Template is licensed under the MIT License. # See: https://github.com/jekyll-one-org/J1 Template/blob/master/LICENSE # # ----------------------------------------------------------------------------- # Test data: # liquid_var: {{ liquid_var | debug }} # topsearch_options: {{ topsearch_options | debug }} # ----------------------------------------------------------------------------- {% endcomment %} {% comment %} Liquid procedure parameter|s -------------------------------------------------------------------------------- {% endcomment %} {% assign topsearch_options = include.options %} {% 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 config files -------------------------------------------------------------------------------- {% endcomment %} {% comment %} TODO: Params should passed by the generator -------------------------------------------------------------------------------- {% assign quick_search_config = site.data.modules.j1_jekyll_search %} {% assign elastic_search_config = site.data.modules.j1_elastic_search %} -------------------------------------------------------------------------------- {% endcomment %} {% comment %} Set quicksearch properties -------------------------------------------------------------------------------- {% endcomment %} {% assign topsearch_id = topsearch_options.container_id %} {% assign icon_family = topsearch_options.icon_family | downcase %} {% assign placeholder = topsearch_options.placeholder %} {% assign search_heading_lead = topsearch_options.search_heading_lead %} {% assign result_heading_lead = topsearch_options.result_heading_lead %} {% assign search_icon = topsearch_options.search_icon %} {% assign close_icon = topsearch_options.close_icon %} {% assign clear_icon = topsearch_options.clear_icon %} {% assign quick_search = true %} {% assign elastic_search = false %} {% if topsearch_options.type == 'quick_search' %} {% assign quick_search = true %} {% endif %} {% if topsearch_options.type == 'elastic_search' %} {% assign elastic_search = true %} {% assign quick_search = false %} {% endif %} {% if topsearch_options.icon_family == 'FontAwesome' or topsearch_options.icon_family == 'FontAwesome4' or topsearch_options.icon_family == 'FontAwesome5' %} {% assign icon_family = 'fa' %} {% elsif topsearch_options.icon_family == 'MDI' or topsearch_options.icon_family == 'Material Design Icons'%} {% assign icon_family = 'mdi' %} {% else %} {% assign icon_family = 'mdi' %} {% endif %} {% include {{select_color}} color=topsearch_options.icon_color fallback="#9E9E9E" %} {% capture icon_color %}style="color:{{color}}"{% endcapture %} {% include {{select_icon_size}} family=topsearch_options.icon_family size=topsearch_options.icon_size %} {% assign icon_size = size %} {% comment %} Main -------------------------------------------------------------------------------- {% endcomment %} {% if topsearch_options.enabled %} {% comment %} lunrSearch engine ------------------------------------------------------------------------------ {% endcomment %} {% if quick_search %}
{% endif %}