From ec74f9a92414323967b59a96e9f055b7b3ca8435 Mon Sep 17 00:00:00 2001 From: Qeole Date: Wed, 29 Mar 2023 23:05:18 +0100 Subject: [PATCH] Use logo_url instead of "logo", removed in Sphinx 6 In commit sphinx-doc/sphinx@ac0fc4b78173 ("Remove more deprecated items in Sphinx 6.0 (#10562)"), Sphinx removed the deprecated variables "logo" and "favicon", in favour of "logo_url" and "favicon_url", respectively. As a consequence, including the logo defined in "html_logo" no longer works when the sphinx_material theme is used with Sphinx >= 6. Let's use logo_url if available in header.html. We also use it in sidebar.html, although this one doesn't matter much because CSS class md-nav__button gets a "display:none" in application.css. --- sphinx_material/sphinx_material/header.html | 3 +++ sphinx_material/sphinx_material/sidebar.html | 2 ++ 2 files changed, 5 insertions(+) diff --git a/sphinx_material/sphinx_material/header.html b/sphinx_material/sphinx_material/header.html index 7c49b4d4f..8916e81a4 100644 --- a/sphinx_material/sphinx_material/header.html +++ b/sphinx_material/sphinx_material/header.html @@ -6,6 +6,9 @@ class="md-header-nav__button md-logo"> {% if theme_logo_icon|e %} {{ theme_logo_icon }} + {% elif logo_url %} + {{ shorttitle|striptags|e }} logo {% elif logo %} {{ shorttitle|striptags|e }} logo diff --git a/sphinx_material/sphinx_material/sidebar.html b/sphinx_material/sphinx_material/sidebar.html index bfa74a213..02ee1bbce 100644 --- a/sphinx_material/sphinx_material/sidebar.html +++ b/sphinx_material/sphinx_material/sidebar.html @@ -3,6 +3,8 @@