From ea9cccb87c8fd2f1465af4d3f4c0b59c3410eea8 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Fri, 6 Dec 2024 23:29:34 +0100 Subject: [PATCH 1/5] 404: be more helpful about outdated versions People used to link to specific versions of manual pages (as reported in https://github.com/git/git-scm.com/issues/1927). Instead of showing a plain 404 page, try to be slightly more helpful by telling the reader that this version no longer exists, providing a link to the newest version. Then, also try to figure out what the most closely-matching page is that _is_ available, and if one is found, show that one, too. Signed-off-by: Johannes Schindelin --- content/404.html | 44 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/content/404.html b/content/404.html index 79772f91c5..e02a6d6a78 100644 --- a/content/404.html +++ b/content/404.html @@ -7,7 +7,49 @@ }}" alt="404" width="456" height="149" />

That page doesn't exist.

-

+

We recently redesigned the site and older URLs may now lead to missing pages. We apologize for the inconvenience.

+ From 06fe5cb192e4d8f20f889bb03d7ff87bd8e8ac62 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Fri, 6 Dec 2024 23:57:05 +0100 Subject: [PATCH 2/5] 404: avoid bogus links to non-existing pages It is theoretically possible that a Git command no longer exists and therefore is no longer documented, either, yet there are links out there pointing to said documentation. Let's try to be somewhat helpful by detecting that situation and directing the reader to the top-level documentation page. Signed-off-by: Johannes Schindelin --- content/404.html | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/content/404.html b/content/404.html index e02a6d6a78..dbdf4969be 100644 --- a/content/404.html +++ b/content/404.html @@ -25,6 +25,12 @@

That page doesn't exist.

(async () => { // fetch the newest version to obtain the list of versions const result = await fetch(url) + if (result.status < 200 || result.status >= 300) { + el.innerHTML = `The page ${command} does not exist in the documentation.` + return + } const div = document.createElement('div') div.innerHTML = await result.text() From c22d0df631bdb2aa259fbda733d3e28fa3410374 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Fri, 6 Dec 2024 23:46:39 +0100 Subject: [PATCH 3/5] 404: also be more helpful about non-existing book pages Just like was just done for non-existing documentation pages, let's be more helpful for missing book pages, too. Signed-off-by: Johannes Schindelin --- content/404.html | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/content/404.html b/content/404.html index dbdf4969be..f9a9e85113 100644 --- a/content/404.html +++ b/content/404.html @@ -12,7 +12,7 @@

That page doesn't exist.

From 5c36db77d7e16a18f25c5bae313207f0ff3df72b Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Sat, 7 Dec 2024 08:31:09 +0000 Subject: [PATCH 4/5] Fix a typo! Co-authored-by: Loymdayddaud <145969603+TheGiraffe3@users.noreply.github.com> --- content/404.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/404.html b/content/404.html index f9a9e85113..71a54a15de 100644 --- a/content/404.html +++ b/content/404.html @@ -52,7 +52,7 @@

That page doesn't exist.

let i = -1 while (i + 1 < versions.length && versionCompare(version, versions[i + 1]) < 0) i++ - if (versions[i]) el.innerHTML += `
The most closesely matching page describes version ${versions[i]}.` })().catch(console.error) From dea2937392cf8236bf596120c193af4575cf0eeb Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Wed, 11 Dec 2024 13:03:33 +0100 Subject: [PATCH 5/5] Upgrade the Hugo version Not that we don't trust our Markdown files, but just to avoid having to deal with any reports about using "an unsafe Hugo version"... see https://github.com/gohugoio/hugo/security/advisories/GHSA-c2xf-9v2r-r2rx for more details. Signed-off-by: Johannes Schindelin --- hugo.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hugo.yml b/hugo.yml index 1fb7f8db69..35246dfcc2 100644 --- a/hugo.yml +++ b/hugo.yml @@ -31,7 +31,7 @@ module: - source: external/docs/content target: content params: - hugo_version: 0.134.3 + hugo_version: 0.139.4 pagefind_version: 1.1.1 latest_version: 2.47.1 latest_relnote_url: https://raw.github.com/git/git/master/Documentation/RelNotes/2.47.1.txt