mirror of
https://gitlab.com/veilid/veilid-dot-com.git
synced 2025-02-06 18:35:32 -05:00
10 lines
689 B
Twig
10 lines
689 B
Twig
{%- if page.alternates is defined -%}
|
|
{%- if title is not defined %}{% set title = page.title %}{% endif -%}
|
|
{%- for alternate in page.alternates ~%}
|
|
{%- if alternate.rel == 'canonical' and page.canonical.url|default %}{# custom canonical URL ~#}
|
|
<link rel="canonical" type="text/html" title="{{ page.canonical.title|default(title|trim) }}" href="{{ url(page.canonical.url) }}" />
|
|
{%- else ~%}
|
|
<link rel="{{ alternate.rel }}" type="{{ alternate.type }}" title="{{ title|trim }}{% if alternate.format != 'html' %} ({{ alternate.title }}){% endif %}" href="{{ url(page, {canonical: true, format: alternate.format}) }}" />
|
|
{%- endif ~%}
|
|
{%- endfor -%}
|
|
{%- endif -%} |