{% 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) 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 %} {% 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 >= 70 %} {% else %} {% endif %} {% elsif page.excerpt %} {% assign size = page.excerpt|size %} {% if size >= 70 %} {% else %} {% endif %} {% else %} {% 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 %} Check robot settings from site configuration -------------------------------------------------------------------------------- {% endcomment %} {% if site.robots.index and site.robots.index <> nil %} {% capture robots_index %}{% endcapture %} {% else %} {% capture robots_index %}{% endcapture %} {% endif %} {% if site.robots.follow and site.robots.follow <> nil %} {% capture robots_follow %}{% endcapture %} {% else %} {% capture robots_follow %}{% endcapture %} {% endif %} {% comment %} page.robots.index: {{ page.robots.index | debug }} {% endcomment %} {% comment %} Check robot settings from page (or default SCOPE) -------------------------------------------------------------------------------- {% endcomment %} {% if page.robots.index %} {% capture robots_index %}{% endcapture %} {% endif %} {% if page.robots.index == false %} {% capture robots_index %}{% endcapture %} {% endif %} {% if page.robots.follow %} {% capture robots_follow %}{% endcapture %} {% endif %} {% if page.robots.follow == false %} {% capture robots_follow %}{% endcapture %} {% endif %} {{robots_index}} {{robots_follow}} {% if page.analytics and site.data.j1_config.analytics.enabled %} {% capture analytics %}{% endcapture %} {% else %} {% capture analytics %}{% endcapture %} {% endif %} {{analytics}} {% if page.comments and site.data.j1_config.comments.enabled %} {% capture comments %}{% endcapture %} {% else %} {% capture comments %}{% endcapture %} {% endif %} {{comments}} {% if page.advertising and site.data.j1_config.advertising.enabled %} {% capture advertising %}{% endcapture %} {% else %} {% capture advertising %}{% endcapture %} {% endif %} {{advertising}} {% if page.translation and site.data.j1_config.translation.enabled %} {% capture translation %}{% endcapture %} {% else %} {% capture translation %}{% endcapture %} {% endif %} {{translation}} {% if page.youtube %} {% capture youtube %}{% endcapture %} {% else %} {% capture youtube %}{% endcapture %} {% endif %} {{youtube}} {% if page.vimeo %} {% capture vimeo %}{% endcapture %} {% else %} {% capture vimeo %}{% endcapture %} {% endif %} {{vimeo}} {% if page.personalization %} {% capture personalization %}{% endcapture %} {% else %} {% capture personalization %}{% endcapture %} {% endif %} {{personalization}} {% comment %} SEO settings (optimization) -------------------------------------------------------------------------------- {% endcomment %} {% comment %} PRELOAD fonts -------------------------------------------------------------------------------- {% endcomment %} {% if template_config.preload.font.preload %} {% assign cors = template_config.preload.font.cors %} {% assign fonts = template_config.preload.font.fonts %} {% for font in fonts %} {% endfor %} {% else %} {% endif %} {% comment %} PRELOAD CSS files -------------------------------------------------------------------------------- {% endcomment %} {% if template_config.preload.css.preload %} {% assign css = template_config.preload.css.css %} {% assign files = template_config.preload.css.files %} {% for file in css %} {% endfor %} {% for file in files %} {% endfor %} {% else %} {% endif %} {% comment %} PRELOAD JS files -------------------------------------------------------------------------------- {% endcomment %} {% if template_config.preload.js.preload %} {% assign js = template_config.preload.js.js %} {% assign files = template_config.preload.js.files %} {% for file in js %} {% endfor %} {% for file in files %} {% endfor %} {% else %} {% endif %} {% comment %} PRELOAD image files -------------------------------------------------------------------------------- {% endcomment %} {% if template_config.preload.image.preload %} {% assign files = template_config.preload.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 %}