templates: Add rel-canonical link to some documentation pages.

Updates templates/zerver/meta_tags.html to add a rel-canonical
link if REL_CANONICAL_LINK is in the template context dict.

We add REL_CANONICAL_LINK to the documentation context for the
API and integrations documentation pages in all cases. The link
will be self-referencing for the main zulip.com site.

For policies documentation pages, we add REL_CANONICAL_LINK to
the context only when settings.CORPORATE_ENABLED is true, so
that self-hosted servers' policies documentation do not have a
rel-canonical link set.

Part of #35110.
This commit is contained in:
Lauryn Menard
2025-09-29 20:38:46 +02:00
committed by Alex Vandiver
parent 1400ad7307
commit 6fb19fdd2d
2 changed files with 12 additions and 0 deletions

View File

@@ -1,4 +1,7 @@
<!-- Google / search engine tags -->
{% if REL_CANONICAL_LINK %}
<link rel="canonical" href="{{ REL_CANONICAL_LINK }}" />
{% endif %}
{% if allow_search_engine_indexing %}
{% if PAGE_DESCRIPTION %}
<meta name="description" content="{{ PAGE_DESCRIPTION }}" />