{% comment %} # ----------------------------------------------------------------------------- # ~/_includes/templates/j1/modules/attics/generator.html # Liquid template to create the attic (top page header) of a page # # Product/Info: # https://jekyll.one # # Copyright (C) 2021 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 }} # ----------------------------------------------------------------------------- {% 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 %} Process YML config data ================================================================================ {% endcomment %} {% comment %} Set config files -------------------------------------------------------------------------------- {% endcomment %} {% assign modules = site.data.modules %} {% comment %} Set config data -------------------------------------------------------------------------------- {% endcomment %} {% assign attic_defaults = modules.defaults.attics.defaults %} {% assign attic_settings = modules.attics.settings %} {% comment %} Set config options -------------------------------------------------------------------------------- {% endcomment %} {% assign attic_options = attic_defaults | merge: attic_settings %} {% 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 attic values -------------------------------------------------------------------------------- {% endcomment %} {% for item in attic_options.attics %} {% if item.attic.enabled %} {% comment %} Detect attic for the page (layout) --------------------------------------------------------------------------- {% endcomment %} {% assign attic_id = item.attic.id %} {% if item.attic.layout contains page.layout %} {% assign attic = item.attic.id %} {% assign action_enabled = item.attic.action.enabled %} {% if action_enabled %} {% assign action_url = item.attic.action.url %} {% assign action_button = item.attic.action.button %} {% assign action_icon = item.attic.action.icon %} {% assign action_icon_family = item.attic.action.icon_family %} {% assign action_text = item.attic.action.text %} {% endif %} {% assign logo_enabled = item.attic.logo.enabled %} {% if logo_enabled %} {% assign logo_url = item.attic.logo.url %} {% assign logo_alt = item.attic.logo.alt %} {% assign logo_height = item.attic.logo.height %} {% assign logo_animate = item.attic.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 attic 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 attic action and logo (currently NOT supported) -------------------------------------------------------------------------------- {% endcomment %} {% assign action_enabled = false %} {% assign logo_enabled = false %} {% comment %} Main -------------------------------------------------------------------------------- {% endcomment %} {% if attic %} {% comment %} Place attic detected ------------------------------------------------------------------------------- {% endcomment %}
{% if logo_enabled %}

{{imageAlt}}

{% endif %}

{{page.title}}

{{page.tagline}}

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