From patchwork Wed Nov 6 07:48:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antonin Godard X-Patchwork-Id: 52084 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 25F96D29FB8 for ; Wed, 6 Nov 2024 07:48:55 +0000 (UTC) Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [217.70.183.199]) by mx.groups.io with SMTP id smtpd.web10.40952.1730879326234660483 for ; Tue, 05 Nov 2024 23:48:46 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=MdNr+5wJ; spf=pass (domain: bootlin.com, ip: 217.70.183.199, mailfrom: antonin.godard@bootlin.com) Received: by mail.gandi.net (Postfix) with ESMTPSA id 9FC57FF812; Wed, 6 Nov 2024 07:48:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1730879324; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=SZUQ9TdDZ2hrpecaB7r3rG4NAoZERhsy8me1AGx8s/M=; b=MdNr+5wJvacxbWh0mVSqxhURCtOhTUVG/tsYC+tbnAFJVsb4bD7PgXBburb4NmXYY/qMkt LaPvYSkMKCuKKufzUATOchL0/ircUKGKM40Bh2FWyMxqqWnTNjsu8Jde2uNmGV/P4emsfE iNuEMDDp5Ntr9HmW9BySN/08WgpVgwUofuuqPLJvcfE5/lK/nzd9toFEtWecnGOky+3Mjh O4Tx0N6J8XC3Y6B1II5FeJqEAznFHcrR9B5GryjdrO2OHyYUC0zyyUPScU2ZoUy9h68Q3u fSj29L0UY/mDdtk5ux5eq+koxHcPw9RcG99FtDNVUumkABUzVS2gPCeZ0hSGfA== From: Antonin Godard Date: Wed, 06 Nov 2024 08:48:27 +0100 Subject: [PATCH 5/5] sphinx-static/switchers.js.in: do not refer to URL_ROOT anymore MIME-Version: 1.0 Message-Id: <20241106-pdf-xetex-v1-5-044eab7e77d3@bootlin.com> References: <20241106-pdf-xetex-v1-0-044eab7e77d3@bootlin.com> In-Reply-To: <20241106-pdf-xetex-v1-0-044eab7e77d3@bootlin.com> To: docs@lists.yoctoproject.org Cc: Thomas Petazzoni , Richard Purdie , Antonin Godard X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1404; i=antonin.godard@bootlin.com; h=from:subject:message-id; bh=y/rIEkrRil314mOgCj4Y3usRFzdTad1jya7AtOkpRao=; b=owEBbQKS/ZANAwAIAdGAQUApo6g2AcsmYgBnKx9a/vbI9QGKc2BFhcPvrQLbg7vG1sy+G5vod LLdGU62d/yJAjMEAAEIAB0WIQSGSHJRiN1AG7mg0//RgEFAKaOoNgUCZysfWgAKCRDRgEFAKaOo Nr1WD/9KNQrMhNSzF4cnRvVGLm4NgRmJi39OKbtsNBvTPEFUyYWwx9UglrhpfC9ZaUfKSpoYU3J kevPAT8iDXSB7dK8r1cSd47yNWzwc2vn90E4+WKpBqNABuugE+FBXYEyjL+lWI0ksbwOmcRJZMM C+HajQaALzGzW0J04sg8/Jcm+dP7PiSlmy++7Un0P5b+hp8Q36Ij7mppK642WCoVNlSSWMDjydd 3l5hXMImDus/C/fZtRn2j8gf7QUZfBzauRSGMYnwmAj6ghmArKqCJG9SVjDiW7w/znFf86L2a1P DPww0si9rUsPna/9+zAdBVeaTPg7ufsjHeq89JuxgfCw4iMJuE7oB1q3yZAzu8Zulnl5/p6nlB4 +7LTEqswEScYm10s1yqD1FGUlH0ESmCLfYNP5A6VE+kRHxyGsdsCuzorfPDw9NUfNAE1zP/XXeU kE48+Le31AVEobrvL4ue4qhHJMr0fxmK73EEecvQGINowEyJaF7NA+nR3DQLP+YRfpRtcBqEZEd vVka3dFVVit7PeJ4Qg3l1MsDVedG3YXzTVg0ImnKWO82BnDIUULQbu7BWfoQ3k8bkUSpOQZDiZz 9WEtiKd/E8YId6tfWk2Ehyt/OfA1PZN7gYLFXK48pkZh4jIKV4gbHB/3xn/eYcXNNw5xQaAvLrW a/Nr26BmDTOxUgA== X-Developer-Key: i=antonin.godard@bootlin.com; a=openpgp; fpr=8648725188DD401BB9A0D3FFD180414029A3A836 X-GND-Sasl: antonin.godard@bootlin.com List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 06 Nov 2024 07:48:55 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/docs/message/5690 This variable was removed from the Sphinx-generated documentation_options.js, thus breaking the current implementation of our switchers.js. Like searchtools.js, which is also generated by Sphinx, use document.documentElement.dataset.content_root as a replacement. To be backwards-compatible to get one or the other. Signed-off-by: Antonin Godard --- documentation/sphinx-static/switchers.js.in | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/documentation/sphinx-static/switchers.js.in b/documentation/sphinx-static/switchers.js.in index 8c016859bc80f03a6322bbea516864f75185c05a..b1c0812b53369b3c635e3466d84ca02f916d34f8 100644 --- a/documentation/sphinx-static/switchers.js.in +++ b/documentation/sphinx-static/switchers.js.in @@ -133,7 +133,13 @@ by https://git.yoctoproject.org/yocto-autobuilder-helper/tree/scripts/run-docs-b function get_docroot_url() { var url = window.location.href; + // Try to get the variable from documentation_options.js var root = DOCUMENTATION_OPTIONS.URL_ROOT; + if (root == null) { + // In recent versions of Sphinx, URL_ROOT was removed from + // documentation_options.js, so get it like searchtools.js does. + root = document.documentElement.dataset.content_root; + } var urlarray = url.split('/'); // Trim off anything after '/'