From 1096046175b4ca1bf47aea8b5cbf632cad2c1ec3 Mon Sep 17 00:00:00 2001 From: Benjamin Glitsos Date: Thu, 3 Oct 2024 16:58:17 +1000 Subject: [PATCH] Used max_page_title_length for more durable title code --- docs/_templates/product-v2.rst | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/docs/_templates/product-v2.rst b/docs/_templates/product-v2.rst index 3b8dd8c6..e118f3ad 100644 --- a/docs/_templates/product-v2.rst +++ b/docs/_templates/product-v2.rst @@ -5,7 +5,13 @@ "tables": load('_tables.yaml'), } %} -{# Terms and static strings #} +{# Constant values #} + +{% set max_page_title_length = 200 %} + +{% set no_data_terms = { + "dash": "\-", +} %} {% set access_labels = { "map": "DEA Maps", @@ -50,10 +56,6 @@ "PAUSED": "Currently paused", } %} -{% set no_data_terms = { - "dash": "\-", -} %} - {# Computed variables #} {% set maps_list = page.data.maps | selectattr("link", "!=", None) | list %} @@ -120,9 +122,9 @@ .. rst-class:: product-page -{{ "=" * 200 }} -{{ page_title }} -{{ "=" * 200 }} +{{ "=" * max_page_title_length }} +{{ page_title | truncate(max_page_title_length) }} +{{ "=" * max_page_title_length }} {% endset %} {# HTML end scripts component #}