{% comment %} # ----------------------------------------------------------------------------- # ~/_includes/templates/j1/modules/headers/masthead.html # Liquid template to create the Master Header (masthead) of a page # # 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_font_size %}themes/{{site.template.name}}/procedures/global/select_font_size.proc{% endcapture %} {% comment %} Variables -------------------------------------------------------------------------------- {% endcomment %} {% assign header_config = site.data.modules.j1_header %} {% comment %} Initialize default values -------------------------------------------------------------------------------- {% endcomment %} {% assign default_style = 'raised' %} {% assign default_logo_height = 128 %} {% assign default_logo_alt = site.title %} {% assign default_logo_animate = 'slideInDown' %} {% assign default_action_text = 'Download Now' %} {% assign default_btnClass = 'btn btn-default' %} {% assign default_icon = 'cloud-download' %} {% assign default_icon_family = 'fa' %} {% comment %} Initialize header values -------------------------------------------------------------------------------- {% endcomment %} {% for item in header_config.headers %} {% if item.header.enabled %} {% comment %} Detect header for the page (layout) --------------------------------------------------------------------------- {% endcomment %} {% assign header_id = item.header.id %} {% if item.header.layout contains page.layout %} {% assign header = item.header.id %} {% assign action_enabled = item.header.action.enabled %} {% if action_enabled %} {% assign action_url = item.header.action.url %} {% assign action_button = item.header.action.button %} {% assign action_icon = item.header.action.icon %} {% assign action_icon_family = item.header.action.icon_family %} {% assign action_text = item.header.action.text %} {% endif %} {% assign logo_enabled = item.header.logo.enabled %} {% if logo_enabled %} {% assign logo_url = item.header.logo.url %} {% assign logo_alt = item.header.logo.alt %} {% assign logo_height = item.header.logo.height %} {% assign logo_animate = item.header.logo.animate %} {% endif %} {% else %} {% continue %} {% endif %} {% endif %} {% endfor %} {% comment %} Initialize logo image -------------------------------------------------------------------------------- {% endcomment %} {% unless logo_height %} {% assign logo_height = default_logo_height %} {% endunless %} {% unless logo_alt %} {% assign logo_alt = default_logo_alt %} {% endunless %} {% comment %} Initialize header action (button) -------------------------------------------------------------------------------- {% endcomment %} {% unless action_text %} {% assign action_text = default_action_text %} {% endunless %} {% unless action_button %} {% assign action_button = default_action_button %} {% endunless %} {% unless action_icon %} {% assign action_icon = default_action_icon %} {% endunless %} {% comment %} Deactivate header action and logo (currently NOT supported) -------------------------------------------------------------------------------- {% endcomment %} {% assign action_enabled = false %} {% assign logo_enabled = false %} {% comment %} Main -------------------------------------------------------------------------------- {% endcomment %} {% if header %} {% comment %} Place header detected ------------------------------------------------------------------------------- {% endcomment %}
{% if logo_enabled %}

{{imageAlt}}

{% endif %}

{{page.title}}

{{page.tagline}}

{% if action_enabled %} {% endif %}
{% else %} {% comment %} No header ------------------------------------------------------------------------------- {% endcomment %}
{% endif %}