From 93571b8e7d15dc9bf671f66198c461e80c98ea84 Mon Sep 17 00:00:00 2001 From: Sergei Kliuikov Date: Thu, 7 Nov 2024 21:28:55 -0800 Subject: [PATCH] Fix(docs): Remove useless duplicates from menu. --- docs_theme/css/default.css | 3 +++ docs_theme/main.html | 18 +++++++++++------- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/docs_theme/css/default.css b/docs_theme/css/default.css index dfde26293..249926a0b 100644 --- a/docs_theme/css/default.css +++ b/docs_theme/css/default.css @@ -453,3 +453,6 @@ ul.sponsor { padding: 0.4rem 0.6rem; } +.doc.doc-object.doc-class .doc.doc-heading { + display: none; +} diff --git a/docs_theme/main.html b/docs_theme/main.html index b4e894781..1afed1dcd 100644 --- a/docs_theme/main.html +++ b/docs_theme/main.html @@ -86,15 +86,19 @@ {% endif %} {% for toc_item in page.toc %} -
  • - {{ toc_item.title }} -
  • - - {% for toc_item in toc_item.children %} -
  • + {% if not toc_item.url.startswith('#rest_framework.') %} +
  • {{ toc_item.title }}
  • - {% endfor %} + + {% for child in toc_item.children %} + {% if not child.url.startswith('#rest_framework.') %} +
  • + {{ child.title }} +
  • + {% endif %} + {% endfor %} + {% endif %} {% endfor %}