{% if page.layout == 'home' or page.layout == 'post' %} {% if site.google_analytics.pv.proxy_endpoint %} {% endif %} {% if site.google_analytics.pv.cache_path %} {% endif %} {% endif %} {% capture seo_tags %} {% seo title=false %} {% endcapture %} {% assign seo_image = page.image | default: page.preview.image | default: page.preview %} {% assign img = seo_image.path | default: seo_image.image | default: seo_image | append: '' %} {%- comment -%} A video-only preview map (no `image`) stringifies to a Ruby hash dump containing "=>" — treat that (and empty) as "no SEO image". {%- endcomment -%} {% if img != '' and img != empty %}{% unless img contains '=>' %} {% assign seo_image_url = img %} {% unless img contains '://' %} {% assign img_path = page.img_path | append: '/' | append: img | replace: '//', '/' %} {% capture target %}"{{ img | absolute_url }}"{% endcapture %} {% if site.img_cdn contains '//' %} {% capture replacement %}"{{ site.img_cdn }}{{ img_path }}"{% endcapture %} {% else %} {%- capture replacement -%} "{{ site.img_cdn | append: '/' | append: img_path | replace: '//', '/' | absolute_url }}" {%- endcapture -%} {% endif %} {% assign seo_tags = seo_tags | replace: target, replacement %} {% assign seo_image_url = replacement | replace: '"', '' | strip %} {% endunless %} {% endunless %}{% endif %} {{ seo_tags }} {%- comment -%} jekyll-seo-tag only emits og/twitter image from `page.image`; posts/drafts use `preview`, so emit those tags manually to keep SEO intact. Guarded on `page.image` being absent to avoid duplicating the plugin's tags for books/poems (which still use `image`). {%- endcomment -%} {% unless page.image %}{% if seo_image_url %} {% endif %}{% endunless %} {% assign page_title = page.title %} {% if page.collection == 'tabs' %} {% assign tab_key = page.title | downcase %} {% assign page_title = site.data.locales[site.lang].tabs[tab_key] | default: page.title %} {% endif %} {%- unless page.layout == "home" -%} {{ page_title | append: " | "}} {%- endunless -%} {{ site.data.locales[site.lang].page.title }} {% include favicons.html %} {% if site.resources.ignore_env != jekyll.environment and site.resources.self_hosted %} {% else %} {% for cdn in site.data.assets[origin].cdns %} {% endfor %} {% endif %} {% if jekyll.environment == 'production' and site.google_analytics.id != empty and site.google_analytics.id %} {% if site.google_analytics.pv.proxy_endpoint %} {% assign proxy_url = site.google_analytics.pv.proxy_endpoint | replace: "https://", "" | split: "/" | first | prepend: "https://" %} {% endif %} {% endif %} {% if page.toc %} {% endif %} {% if page.layout == 'page' or page.layout == 'post' %} {% endif %} {% unless site.theme_mode %} {% include mode-toggle.html %} {% endunless %}