From d9bc11a97920bc1eeb1dba394f4fef6be502eed3 Mon Sep 17 00:00:00 2001 From: Akihiro Motoki Date: Sat, 1 Jul 2017 21:20:36 +0900 Subject: [PATCH] Do not display title string of page local TOC Some pages have no sub titles (the second level of titles or more). In this case, the title string "Contents" of page local TOC is completely meaningless and confusing to readers. It is nice if this title string is shown only when needed. This can be done by checking 'display_toc' variable in the template. [1] https://docs.openstack.org/ocata/networking-guide/intro.html Change-Id: I4803dd7712438eb2cd5fb6084e904bd8c0c98740 --- openstackdocstheme/theme/openstackdocs/localtoc.html | 2 +- ...y-local-toc-title-without-subtitles-4e1fc48705d66289.yaml | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 releasenotes/notes/do-not-display-local-toc-title-without-subtitles-4e1fc48705d66289.yaml diff --git a/openstackdocstheme/theme/openstackdocs/localtoc.html b/openstackdocstheme/theme/openstackdocs/localtoc.html index aaaeae46..2e3dc2a1 100644 --- a/openstackdocstheme/theme/openstackdocs/localtoc.html +++ b/openstackdocstheme/theme/openstackdocs/localtoc.html @@ -1,4 +1,4 @@ -{%- if theme_sidebar_mode == 'toctree' and theme_display_toc %} +{%- if theme_sidebar_mode == 'toctree' and theme_display_toc and display_toc %}
Contents
{{ toc }} {%- endif %} diff --git a/releasenotes/notes/do-not-display-local-toc-title-without-subtitles-4e1fc48705d66289.yaml b/releasenotes/notes/do-not-display-local-toc-title-without-subtitles-4e1fc48705d66289.yaml new file mode 100644 index 00000000..74fbad5a --- /dev/null +++ b/releasenotes/notes/do-not-display-local-toc-title-without-subtitles-4e1fc48705d66289.yaml @@ -0,0 +1,5 @@ +--- +fixes: + - | + The title "Contents" of the page local TOC is now displayed + only when a page has sub-titles.