{%- set config_title = config.title | default(value="") | truncate(length=100) %} {%- set title_separator = config.extra.title_separator | default(value= " | ") %} {%- if page.title %} {%- set page_title = page.title | truncate(length=200) %} {%- if page.description %} {%- set page_description = page.description %} {%- elif page.summary %} {%- set page_description = page.summary | linebreaksbr | striptags | trim_end_matches(pat=`.`) %} {%- endif %} {%- elif taxonomy.name %} {%- set page_title = m_i18n::get_taxonomy_title(key=taxonomy.name, lk=g_lang_k, d=g_trans_d) %} {%- if term.name %} {%- if taxonomy.name == "authors" %} {%- set term_name = m_profiles::get_name(username=term.name) %} {%- else %} {%- set term_name = term.name %} {%- endif %} {%- set page_title = term_name ~ title_separator ~ page_title %} {%- if config.extra.languages[lang].term_descriptions[taxonomy.name] %} {%- set page_description = config.extra.languages[lang].term_descriptions[taxonomy.name] | replace(from=`$NAME`, to=term_name) %} {%- endif %} {%- else %} {%- if config.extra.languages[lang].taxonomy_descriptions[taxonomy.name] %} {%- set page_description = config.extra.languages[lang].taxonomy_descriptions[taxonomy.name] %} {%- endif %} {%- endif %} {%- elif section.title %} {%- set page_title = section.title | truncate(length=200) %} {%- if section.description %} {%- set page_description = section.description %} {%- endif %} {%- elif current_url %} {%- set page_title = config_title %} {%- set page_description = config.description | default(value="") %} {%- else %} {%- set page_title = m_i18n::tr(key=`error_not_found`, lk=g_lang_k, d=g_trans_d) %} {%- set is_404 = true %} {%- endif %} {%- if page_title %} {%- if config_title %} {% if page_title == config_title %}{{ page_title }}{% else %}{{ page_title ~ title_separator ~ config_title }}{% endif %} {%- else %} {{ page_title }} {%- endif %} {%- endif %} {%- if page_description %} {%- endif %} {%- if current_url %} {%- if page.extra.open_graph.url %} {%- elif section.extra.open_graph.url %} {%- else %} {%- endif %} {%- endif %} {%- if g_is_article %} {%- if page.date %} {%- endif %} {%- if page.updated %} {%- endif %} {%- if page.extra.open_graph.expiration_time %} {%- endif %} {%- if page.taxonomies.authors %} {%- for page_author in page.taxonomies.authors %} {%- endfor %} {%- endif %} {%- if page.extra.open_graph.content_tier %} {%- endif %} {%- if page.extra.open_graph.section %} {%- endif %} {%- if page.extra.open_graph.opinion is defined %} {%- endif %} {%- if page.extra.open_graph.locations %} {%- for og_location in page.extra.open_graph.locations %} {%- endfor %} {%- endif %} {%- if page.taxonomies.tags %} {%- for og_tag in page.taxonomies.tags %} {%- endfor %} {%- endif %} {%- elif g_profile is defined %} {%- if g_profile.open_graph.first_name %} {%- endif %} {%- if g_profile.open_graph.last_name %} {%- endif %} {%- if g_profile.open_graph.username %} {%- endif %} {%- if g_profile.open_graph.gender %} {%- endif %} {%- else %} {%- endif %} {%- if g_profile is defined or (config.author and config.extra.profiles[config.author]) %} {#- order is important #} {%- if config.extra.profiles[config.author].open_graph %} {%- set profile_og_data = config.extra.profiles[config.author].open_graph %} {%- if profile_og_data.fb_app_id %} {%- endif %} {%- if profile_og_data.fb_admins %} {%- for fb_admin in profile_og_data.fb_admins %} {%- endfor %} {%- endif %} {%- endif %} {%- if g_profile.open_graph %} {%- set profile_og_data = g_profile.open_graph %} {%- endif %} {%- if profile_og_data.fediverse_creator.handle and profile_og_data.fediverse_creator.domain %} {%- if profile_og_data.fediverse_creator.url %} {%- else %} {%- endif %} {%- endif %} {%- endif %} {%- if g_image_url or g_profile.open_graph.image or ( config.author and config.extra.profiles[config.author].open_graph.image) %} {%- if g_image_url %} {%- set og_image_alt = page.extra.cover.alt | default(value=(section.extra.cover.alt | default(value=""))) %} {%- elif g_profile.open_graph.image %} {%- set og_image_path = g_profile.open_graph.image %} {%- if g_profile.open_graph.languages[lang].image_alt is defined %} {%- set og_image_alt = g_profile.open_graph.languages[lang].image_alt %} {%- else %} {%- set og_image_alt = g_profile.open_graph.image_alt | default(value="") %} {%- endif %} {%- else %} {%- set og_image_path = config.extra.profiles[config.author].open_graph.image %} {%- if config.extra.profiles[config.author].open_graph.languages[lang].image_alt is defined %} {%- set og_image_alt = config.extra.profiles[config.author].open_graph.languages[lang].image_alt %} {%- else %} {%- set og_image_alt = config.extra.profiles[config.author].open_graph.image_alt | default(value=config.author) %} {%- endif %} {%- endif %} {%- if g_image_url %} {%- else %} {%- set g_image_data = get_image_metadata(path=og_image_path, allow_missing=false) %} {%- endif %} {%- if g_image_data.width is defined and g_image_data.height is defined %} {%- endif %} {%- if g_image_data.mime is defined %} {%- endif %} {%- endif %} {%- if page.translations or section.translations %} {%- set page_translations = page.translations | default(value=section.translations) | sort(attribute=`lang`) %} {%- for page_translation in page_translations %} {%- if page_translation.lang == lang and config.extra.languages[lang].locale %} {%- elif config.extra.languages[page_translation.lang].locale %} {%- else %} {%- endif %} {%- endfor %} {%- endif %} {%- if config.generate_feeds or section.generate_feeds or (taxonomy.feed and term.path) %} {%- for feed_filename in config.feed_filenames %} {%- if taxonomy.feed and term.path %} {%- set feed_title = page_title ~ title_separator %} {%- set feed_filename = term.path ~ feed_filename %} {%- elif config_title %} {%- set feed_title = config_title ~ title_separator %} {%- else %} {%- set feed_title = "" %} {%- endif %} {%- if feed_filename is ending_with("atom.xml") %} {%- elif feed_filename is ending_with("rss.xml") %} {%- else %} {%- endif %} {%- endfor %} {%- endif %} {%- if config.extra.webmanifest %} {%- endif %} {%- if config.extra.footer.license_url %} {%- endif %} {%- if config.extra.footer.privacy_policy_url %} {%- endif %} {%- if config.extra.footer.terms_of_service_url %} {%- endif %} {%- if config.extra.footer.search_page_url %} {%- endif %} {#- -#}