From f4642fe1f43e4fe4ffbeb22ea758de645766cb39 Mon Sep 17 00:00:00 2001 From: Dorian Zedler Date: Sun, 7 Aug 2022 10:55:31 +0200 Subject: [PATCH] Chore: use hugo aliases instead of redirect layout (fix #9) --- content/apps/bluerock.md | 2 + content/apps/scrt.md | 2 + content/apps/scstw.md | 2 + content/index.php/apps/bluerock.md | 5 --- .../apps/speed-climbing-stopwatch-app.md | 5 --- ...eed-climbing-stopwatch-reaction-trainer.md | 5 --- content/index.php/speed-climbing.md | 5 --- content/projects/scstw.en.md | 2 + content/scstw.md | 6 --- .../quark-hugo/layouts/_default/redirect.html | 18 -------- themes/quark-hugo/layouts/alias.html | 42 +++++++++++++++++++ .../quark-hugo/layouts/partials/footer.html | 2 +- themes/quark-hugo/layouts/partials/head.html | 4 +- .../quark-hugo/layouts/partials/header.html | 2 +- 14 files changed, 54 insertions(+), 48 deletions(-) delete mode 100644 content/index.php/apps/bluerock.md delete mode 100644 content/index.php/apps/speed-climbing-stopwatch-app.md delete mode 100644 content/index.php/apps/speed-climbing-stopwatch-reaction-trainer.md delete mode 100644 content/index.php/speed-climbing.md delete mode 100644 content/scstw.md delete mode 100644 themes/quark-hugo/layouts/_default/redirect.html create mode 100644 themes/quark-hugo/layouts/alias.html diff --git a/content/apps/bluerock.md b/content/apps/bluerock.md index d8adda7..9c2b193 100644 --- a/content/apps/bluerock.md +++ b/content/apps/bluerock.md @@ -16,6 +16,8 @@ menu: name: blueROCK weight: 1 parent: Apps + +aliases: ["/index.php/apps/bluerock"] --- blueROCK is an app to view climbing results from [digitalrock](https://digitalrock.de) comfortable on the go. diff --git a/content/apps/scrt.md b/content/apps/scrt.md index 3b21320..44acb7d 100644 --- a/content/apps/scrt.md +++ b/content/apps/scrt.md @@ -15,6 +15,8 @@ menu: name: Speed Climbing Reaction Trainer weight: 3 parent: Apps + +aliases: ["/index.php/apps/speed-climbing-stopwatch-reaction-trainer"] --- The Speed Climbing Reaction Trainer is an app to train your reaction time to the IFSC speed climbing start signal. diff --git a/content/apps/scstw.md b/content/apps/scstw.md index 1ea38e7..f8569cf 100644 --- a/content/apps/scstw.md +++ b/content/apps/scstw.md @@ -15,6 +15,8 @@ menu: name: Speed Climbing Stopwatch App weight: 2 parent: Apps + +aliases: ["/index.php/apps/speed-climbing-stopwatch-app"] --- The speed climbing stopwatch app is a simple and lightweight stopwatch app that plays the official IFSC start signal before beginning to stop the time. diff --git a/content/index.php/apps/bluerock.md b/content/index.php/apps/bluerock.md deleted file mode 100644 index 40bf118..0000000 --- a/content/index.php/apps/bluerock.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -layout: redirect -redirectUrl: "/apps/bluerock" -redirectDelay: "0" ---- \ No newline at end of file diff --git a/content/index.php/apps/speed-climbing-stopwatch-app.md b/content/index.php/apps/speed-climbing-stopwatch-app.md deleted file mode 100644 index 514c18a..0000000 --- a/content/index.php/apps/speed-climbing-stopwatch-app.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -layout: redirect -redirectUrl: "/apps/scstw" -redirectDelay: "0" ---- \ No newline at end of file diff --git a/content/index.php/apps/speed-climbing-stopwatch-reaction-trainer.md b/content/index.php/apps/speed-climbing-stopwatch-reaction-trainer.md deleted file mode 100644 index 77085e7..0000000 --- a/content/index.php/apps/speed-climbing-stopwatch-reaction-trainer.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -layout: redirect -redirectUrl: "/apps/scrt" -redirectDelay: "0" ---- \ No newline at end of file diff --git a/content/index.php/speed-climbing.md b/content/index.php/speed-climbing.md deleted file mode 100644 index b9180a1..0000000 --- a/content/index.php/speed-climbing.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -layout: redirect -redirectUrl: "/projects/scstw?ref=ScStwApp" -redirectDelay: "0" ---- \ No newline at end of file diff --git a/content/projects/scstw.en.md b/content/projects/scstw.en.md index 5bd84ee..36c942c 100644 --- a/content/projects/scstw.en.md +++ b/content/projects/scstw.en.md @@ -12,6 +12,8 @@ menu: name: Speed Climbing Stopwatch weight: 2 parent: Projects + +aliases: ["/scstw", "/index.php/speed-climbing"] --- ## What next? diff --git a/content/scstw.md b/content/scstw.md deleted file mode 100644 index 2d10c04..0000000 --- a/content/scstw.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -title: ScStw -layout: redirect -redirectUrl: "/projects/scstw" -bodyClasses: 'title-h1h2 header-animated sticky-footer' ---- \ No newline at end of file diff --git a/themes/quark-hugo/layouts/_default/redirect.html b/themes/quark-hugo/layouts/_default/redirect.html deleted file mode 100644 index 63fc7cd..0000000 --- a/themes/quark-hugo/layouts/_default/redirect.html +++ /dev/null @@ -1,18 +0,0 @@ -{{ define "content" }} - -{{ $redirectUrl := .Params.redirectUrl }} -{{ if hasPrefix .Params.redirectUrl "/" }} - {{ $redirectUrl = printf "%s" .Params.redirectUrl | printf "%s%s" site.BaseURL | printf "%s" }} -{{ end }} -
- -

Redirecting ...

-Click here if nothing happens - - - -
-{{ end }} \ No newline at end of file diff --git a/themes/quark-hugo/layouts/alias.html b/themes/quark-hugo/layouts/alias.html new file mode 100644 index 0000000..760aff4 --- /dev/null +++ b/themes/quark-hugo/layouts/alias.html @@ -0,0 +1,42 @@ + + + {{- partial "head.html" (dict "Title" "redirecting...") -}} + + +
+ + +
+
+ {{ $redirectUrl := .Permalink }} {{ if hasPrefix .Permalink "/" }} {{ + $redirectUrl = printf "%s" .Permalink | printf "%s%s" site.BaseURL | + printf "%s" }} {{ end }} +
+ +

Redirecting ...

+ Click here if nothing happens + + +
+
+
+
+ + {{ block "footer" . }} {{- partial "footer.html" . -}} {{ end }} + + diff --git a/themes/quark-hugo/layouts/partials/footer.html b/themes/quark-hugo/layouts/partials/footer.html index c02a8f6..d56cdbb 100644 --- a/themes/quark-hugo/layouts/partials/footer.html +++ b/themes/quark-hugo/layouts/partials/footer.html @@ -1,5 +1,5 @@