All of lore.kernel.org
 help / color / mirror / Atom feed
From: Quentin Schulz <foss+yocto@0leil.net>
To: docs@lists.yoctoproject.org
Cc: Quentin Schulz <quentin.schulz@theobroma-systems.com>,
	Quentin Schulz <foss+yocto@0leil.net>
Subject: [PATCH 1/3] docs: sphinx-static: switchers.js.in: remove duplicate for outdated versions
Date: Thu, 14 Apr 2022 13:33:25 +0200	[thread overview]
Message-ID: <20220414113327.176534-1-foss+yocto@0leil.net> (raw)

From: Quentin Schulz <quentin.schulz@theobroma-systems.com>

Since commit f2b069be8c307 "set_versions: Various improvements", an
outdated version will always appear in all_versions, meaning there'll
always be an exact match in the loop (just above the git context of this
patch) so there's no need to add the current_version to the dropdown
menu manually.

This issue showed up only for outdated versions of obsolete releases,
e.g. 3.2.3. In that case, 3.2.4 (latest version of the obsolete release)
will appear in the all_versions array in addition to 3.2.3, which means
the check on release series (3.2) will be matched twice, and 3.2.3 will
be printed once in the 3.2.4 loop because version != current_version and
once in the 3.2.3 because it is an exact match to an entry in
all_versions.

Cc: Quentin Schulz <foss+yocto@0leil.net>
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
---
 documentation/sphinx-static/switchers.js.in | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/documentation/sphinx-static/switchers.js.in b/documentation/sphinx-static/switchers.js.in
index 5d3a4d793..e7ef2ce5f 100644
--- a/documentation/sphinx-static/switchers.js.in
+++ b/documentation/sphinx-static/switchers.js.in
@@ -72,9 +72,6 @@ by https://git.yoctoproject.org/yocto-autobuilder-helper/tree/scripts/run-docs-b
             buf.push('<option value="' + version + '" selected="selected">' + title + '</option>');
         else
             buf.push('<option value="' + version + '">' + title + '</option>');
-
-        if (version != current_version)
-            buf.push('<option value="' + current_version + '" selected="selected">' + current_version + '</option>');
       } else {
         buf.push('<option value="' + version + '">' + title + '</option>');
       }
-- 
2.35.1



             reply	other threads:[~2022-04-14 16:03 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-14 11:33 Quentin Schulz [this message]
2022-04-14 11:33 ` [PATCH 2/3] docs: set_versions.py: add information about obsolescence of a release Quentin Schulz
2022-04-14 11:33 ` [PATCH 3/3] docs: sphinx-static: switchers.js.in: improve obsolete version detection Quentin Schulz
2022-04-15 13:37   ` [docs] " Michael Opdenacker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220414113327.176534-1-foss+yocto@0leil.net \
    --to=foss+yocto@0leil.net \
    --cc=docs@lists.yoctoproject.org \
    --cc=quentin.schulz@theobroma-systems.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.