{% comment %} # ----------------------------------------------------------------------------- # ~/_includes/themes/j1/layouts/meta_data_generator.html # Liquid template to generate all meta data for all pages # # Product/Info: # https://jekyll.one # # Copyright (C) 2020 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 %} {% comment %} Process YML config data ================================================================================ {% endcomment %} {% comment %} Set config files -------------------------------------------------------------------------------- {% endcomment %} {% assign template_config = site.data.j1_config %} {% assign blocks = site.data.blocks %} {% assign modules = site.data.modules %} {% comment %} Set GLOBAL variables -------------------------------------------------------------------------------- {% endcomment %} {% case site.environment %} {% when 'production' %} {% assign ext_css = 'min.css' %} {% assign ext_js = 'min.js' %} {% when 'prod' %} {% assign ext_css = 'min.css' %} {% assign ext_js = 'min.js' %} {% else %} {% assign ext_css = 'css' %} {% assign ext_js = 'js' %} {% endcase %} {% comment %} Main -------------------------------------------------------------------------------- {% endcomment %} {% if template_config.translation.enabled %} {% endif %} {% if page.layout == 'home' %} {{site.slogan}} {% else %} {{page.tagline}} {% endif %} {% if page.layout == 'home' %} {% if site.description %} {% assign size = site.description|size %} {% if size >= 70 %} {% else %} {% endif %} {% endif %} {% else %} {% if page.description %} {% assign size = site.description|size %} {% if size >= 15 %} {% else %} {% endif %} {% endif %} {% endif %} {% if site.favicon.image %} {% endif %} {% if page.layout == 'home' %} {% if page.author %} {% else %} {% endif %} {% else %} {% if page.author %} {% else %} {% endif %} {% endif %} {% if page.layout == 'home' %} {% if page.keywords %} {% else %} {% if site.keywords %} {% endif %} {% endif %} {% else %} {% if page.keywords %} {% else %} {% if site.keywords %} {% endif %} {% endif %} {% endif %} {% comment %} site check DISABLED -------------------------------------------------------------------------------- {% if site.robots.index %} {% else %} {% endif %} {% if site.robots.follow %} {% else %} {% endif %} -------------------------------------------------------------------------------- {% endcomment %} {% comment %} Check robot settings from page (or default SCOPE) NOTE: for layout home (home page, the keys are to be set!!!) -------------------------------------------------------------------------------- {% endcomment %} {% if page.robots.index %} {% else %} {% endif %} {% if page.robots.follow %} {% else %} {% endif %} {% comment %} SEO settings (optimization) -------------------------------------------------------------------------------- {% endcomment %} {% comment %} PRELOAD fonts -------------------------------------------------------------------------------- {% endcomment %} {% if template_config.font.preload %} {% assign cors = template_config.font.cors %} {% assign fonts = template_config.font.fonts %} {% for font in fonts %} {% endfor %} {% else %} {% endif %} {% comment %} PRELOAD CSS files -------------------------------------------------------------------------------- {% endcomment %} {% if template_config.css.preload %} {% assign css = template_config.css.css %} {% assign files = template_config.css.files %} {% for file in css %} {% endfor %} {% for file in files %} {% endfor %} {% else %} {% endif %} {% comment %} PRELOAD JS files -------------------------------------------------------------------------------- {% endcomment %} {% if template_config.js.preload %} {% assign js = template_config.js.js %} {% assign files = template_config.js.files %} {% for file in js %} {% endfor %} {% for file in files %} {% endfor %} {% else %} {% endif %} {% comment %} PRELOAD image files -------------------------------------------------------------------------------- {% endcomment %} {% if template_config.image.preload %} {% assign files = template_config.image.files %} {% for file in files %} {% endfor %} {% else %} {% endif %} {% comment %} Request PRECONNECT of 3rd party origins (SEO) -------------------------------------------------------------------------------- {% endcomment %} {% if template_config.preconnect.enabled %} {% assign urls = template_config.preconnect.urls %} {% for url in urls %} {% endfor %} {% else %} {% endif %}