From f7d5cd569074b1ed49a7fca84bf8560fbdfb4e95 Mon Sep 17 00:00:00 2001 From: Lauryn Menard Date: Wed, 18 Jan 2023 19:13:33 +0100 Subject: [PATCH] documentation: Remove "not_index_page" from context. In commit bbecd41, we added "not_index_page" to the context for some documentation articles, but use of that context key/value was removed when the help documentation was removed in commit 1cf7ee9. Changes `not_index_page` to be a boolean value that's used to set the page title, but is not then passed on as a context key/value. Also removes an irrelevant comment about disabling "Back to home" on the homepage. --- zerver/views/documentation.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/zerver/views/documentation.py b/zerver/views/documentation.py index 0ec7d6b984..448e3ea4ec 100644 --- a/zerver/views/documentation.py +++ b/zerver/views/documentation.py @@ -148,6 +148,8 @@ class MarkdownDirectoryView(ApiURLView): documentation_article = self.get_path(article) context["article"] = documentation_article.article_path + not_index_page = not context["article"].endswith("/index.md") + if documentation_article.article_path.startswith("/") and os.path.exists( documentation_article.article_path ): @@ -163,8 +165,6 @@ class MarkdownDirectoryView(ApiURLView): settings.DEPLOY_ROOT, "templates", documentation_article.article_path ) - # For disabling the "Back to home" on the homepage - context["not_index_page"] = not context["article"].endswith("/index.md") if self.path_template == "/zerver/help/%s.md": context["page_is_help_center"] = True context["doc_root"] = "/help/" @@ -211,7 +211,7 @@ class MarkdownDirectoryView(ApiURLView): else: article_title = first_line.lstrip("#").strip() endpoint_name = endpoint_method = None - if context["not_index_page"]: + if not_index_page: context["PAGE_TITLE"] = f"{article_title} | {title_base}" else: context["PAGE_TITLE"] = title_base