From a19c16f894fa63f71926374bce68d66b64d81d05 Mon Sep 17 00:00:00 2001 From: Carmen Bianca BAKKER Date: Fri, 23 Aug 2024 14:17:00 +0200 Subject: [PATCH] Fix redirect to use English-language version The problem: Sometimes, when Hugo generated the website, the `/spec/` alias would point to the Ukrainian translation of the latest specification. Exactly how or why this happens is unclear to me, but I suspect it is because the Ukrainian Markdown file would also contain the `aliases: ["/spec"]` frontmatter, and the Hugo compiler would somehow toss a coin on which aliases frontmatter is authoritative. Here, we get rid of the frontmatter method of doing aliases, and instead use a 'layout' to effectively do the same thing. Signed-off-by: Carmen Bianca BAKKER --- site/config.toml | 2 ++ site/content/en/spec-3.2.md | 2 -- site/content/en/spec.md | 7 +++++++ site/layouts/_default/redirect_current_spec.html | 14 ++++++++++++++ 4 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 site/content/en/spec.md create mode 100644 site/layouts/_default/redirect_current_spec.html diff --git a/site/config.toml b/site/config.toml index b76dcd64..feb89254 100644 --- a/site/config.toml +++ b/site/config.toml @@ -43,6 +43,8 @@ refLinksErrorLevel = "warning" header_link_color="#777" header_link_hover_color="rgb(51, 51, 51)" + current_spec="spec-3.2" + [params.social] Github = "search?q=topic%3Areuse+org%3Afsfe&type=Repositories" Git = "https://git.fsfe.org/reuse" diff --git a/site/content/en/spec-3.2.md b/site/content/en/spec-3.2.md index 530a4580..1bb1f3b2 100644 --- a/site/content/en/spec-3.2.md +++ b/site/content/en/spec-3.2.md @@ -6,8 +6,6 @@ title: "REUSE Specification – Version 3.2" subtitle: "2024-07-03" -aliases: - - "/spec" --- This specification defines a standardised method for declaring copyright and diff --git a/site/content/en/spec.md b/site/content/en/spec.md new file mode 100644 index 00000000..6bc4ba0c --- /dev/null +++ b/site/content/en/spec.md @@ -0,0 +1,7 @@ +--- +# SPDX-FileCopyrightText: 2024 Free Software Foundation Europe e.V. +# SPDX-License-Identifier: MIT + +title: "REUSE Specification" +layout: "redirect_current_spec" +--- diff --git a/site/layouts/_default/redirect_current_spec.html b/site/layouts/_default/redirect_current_spec.html new file mode 100644 index 00000000..89ed391a --- /dev/null +++ b/site/layouts/_default/redirect_current_spec.html @@ -0,0 +1,14 @@ + + + + + REUSE Specification + + + + + +