{% import "macros/macros.html" as post_macros %} {% if config.extra.fediverse %} {% endif %} {% if page.extra.meta %} {% for data in page.extra.meta %} {% endfor %} {% endif %} {# ===== SEO ===== #} {% set is_404 = current_path is not defined %} {% set current_path = current_path | default(value="/") %} {% set site_name = config.extra.site_name | default(value=config.title) %} {% set author = config.extra.author | default(value=site_name) %} {# Título #} {% if is_404 %} {% set_global seo_title = "Página no encontrada | " ~ site_name %} {% elif current_path == "/" %} {% set_global seo_title = site_name ~ " — " ~ config.description | trim_end_matches(pat=".") %} {% elif term %} {% set_global seo_title = "Entradas sobre «" ~ term.name ~ "» | " ~ site_name %} {% elif taxonomy %} {% set_global seo_title = "Etiquetas | " ~ site_name %} {% elif page.title %} {% set_global seo_title = page.title ~ " | " ~ site_name %} {% elif section.title %} {% set_global seo_title = section.title ~ " | " ~ site_name %} {% else %} {% set_global seo_title = site_name %} {% endif %} {# Descripción #} {% if page.description %} {% set_global seo_description = page.description %} {% elif section.description %} {% set_global seo_description = section.description %} {% elif term %} {% set_global seo_description = "Artículos de " ~ site_name ~ " sobre " ~ term.name ~ "." %} {% elif taxonomy %} {% set_global seo_description = "Todas las etiquetas del blog de " ~ site_name ~ "." %} {% else %} {% set_global seo_description = config.description %} {% endif %} {# URL canónica #} {% if page.permalink %} {% set_global seo_url = page.permalink %} {% elif section.permalink %} {% set_global seo_url = section.permalink %} {% elif term %} {% set_global seo_url = term.permalink %} {% else %} {% set_global seo_url = current_url | default(value=config.base_url) %} {% endif %} {# Imagen para redes sociales #} {% if page.extra.image %} {% set_global seo_image = get_url(path=page.extra.image) %} {% elif section.extra.image %} {% set_global seo_image = get_url(path=section.extra.image) %} {% elif config.extra.og_image %} {% set_global seo_image = get_url(path=config.extra.og_image) %} {% else %} {% set_global seo_image = "" %} {% endif %} {% set is_article = page.date and page.components and page.components | first == "posts" %} {{ seo_title }} {% if not is_404 %}{% endif %} {% set is_nota = page.components and page.components | first == "notas" %} {% if page.extra.noindex or section.extra.noindex or is_404 or is_nota %} {% else %} {% endif %} {% if not page_has_description %} {% endif %} {# Open Graph #} {% if not page_has_og_title %} {% endif %} {% if not page_has_og_description %} {% endif %} {% if seo_image %} {% endif %} {% if is_article %} {% if page.updated %} {% endif %} {% if page.taxonomies.tags %} {% for tag in page.taxonomies.tags %} {% endfor %} {% endif %} {% else %} {% endif %} {# Twitter / X #} {% if config.extra.twitter_handle %} {% endif %} {# Verificación de identidad (Mastodon, IndieWeb) #} {% set_global same_as = [] %} {% for social in config.extra.socials | default(value=[]) %} {% if social.url is not starting_with("mailto:") %} {% set_global same_as = same_as | concat(with=social.url) %} {% endif %} {% endfor %} {# Datos estructurados (schema.org) #} {% if current_path == "/" and not is_404 %} {% elif is_article %} {% endif %} {# ===== /SEO ===== #} {# Favicon #} {% if config.extra.favicon %} {% endif %} {# Font from cdn or disk #} {% if config.extra.use_cdn | default(value=false) %} {% else %} {% endif %} {# Syntax theme #} {% if config.markdown.highlight_code and config.markdown.highlight_theme == "css" %} {% endif %} {# Analytics #} {% if config.extra.analytics.enabled %} {% if config.extra.analytics.umami.website_id %} {% set website_id = config.extra.analytics.umami.website_id %} {% set host_url = config.extra.analytics.umami.host_url | default(value="https://api-gateway.umami.dev/") %} {% endif %} {% if config.extra.analytics.goatcounter.user %} {% set user = config.extra.analytics.goatcounter.user %} {% set host = config.extra.analytics.goatcounter.host | default(value="goatcounter.com") %} {% endif %} {% if config.extra.analytics.google.tracking_id %} {% set tracking_id = config.extra.analytics.google.tracking_id %} {% endif %} {% endif %} {# Fancy Codeblock #} {% if config.extra.fancy_code %} {% endif %} {# Table of contents #} {% if config.extra.toc | default(value=false) %} {% endif %} {# Dynamic Note #} {% if config.extra.dynamic_note | default(value=false) %} {% endif %} {% if page.extra.mathjax | default(value=config.extra.mathjax | default(value=false)) %} {% if config.extra.mathjax_dollar_inline_enable | default(value=false) %} {% endif %} {% endif %} {# RSS #} {% if config.generate_feeds %} {% for feed_filenames in config.feed_filenames %} {% if feed_filenames == "atom.xml" %} {% elif feed_filenames == "rss.xml" %} {% endif %} {% endfor %} {% endif %} {% set theme = config.extra.theme | default(value="toggle") %} {% if theme == "dark" %} {% elif theme == "light" %} {% elif theme == "auto" %} {% elif theme == "toggle" %} {% endif %} {% if theme == "auto" or theme == "toggle" %} {% if theme == "auto" %} {% else %} {% endif %} {% endif %} {% if config.extra.stylesheets %} {% for stylesheet in config.extra.stylesheets %} {% endfor %} {% endif %} {# Search #} {%- if config.build_search_index -%} {%- if config.search.index_format -%} {%- set search_index_format = config.search.index_format -%} {%- elif config.extra.index_format -%} {# Necessary to support Zola 0.17.X, as it doesn't have access to config.search.index_format #} {# See: https://github.com/getzola/zola/issues/2165 #} {%- set search_index_format = config.extra.index_format -%} {%- else -%} {%- set search_index_format = "elasticlunr_json" -%} {%- endif -%} {%- if search_index_format == "elasticlunr_javascript" -%} {%- endif -%} {# Main search script #} {%- endif -%}