guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

branch master updated: website: posts: Tag URLs are include the language


From: Ludovic Courtès
Subject: branch master updated: website: posts: Tag URLs are include the language tag.
Date: Tue, 10 Aug 2021 04:48:57 -0400

This is an automated email from the git hooks/post-receive script.

civodul pushed a commit to branch master
in repository guix-artwork.

The following commit(s) were added to refs/heads/master by this push:
     new 388791a  website: posts: Tag URLs are include the language tag.
388791a is described below

commit 388791a9a2e2959cc4e3bbefa3410587f181f1ac
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Tue Aug 10 10:38:40 2021 +0200

    website: posts: Tag URLs are include the language tag.
    
    Previously, tag links at the bottom of a post would look like
    "/blog/tags/performance", which is 404.  This patch changes it to
    "/LANG/blog/tags/performance".
    
    * website/apps/blog/utils.scm (tag-url-path): Add empty string argument
    to 'url-path-join'.
    * website/tests/apps/blog/utils.scm ("[procedure] tag-url-path"): Adjust
    accordingly.
---
 website/apps/blog/utils.scm       | 6 ++++--
 website/tests/apps/blog/utils.scm | 2 +-
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/website/apps/blog/utils.scm b/website/apps/blog/utils.scm
index 501cbf0..96a8f0e 100644
--- a/website/apps/blog/utils.scm
+++ b/website/apps/blog/utils.scm
@@ -1,5 +1,5 @@
 ;;; GNU Guix web site
-;;; Copyright © 2016, 2017, 2020 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2016, 2017, 2020, 2021 Ludovic Courtès <ludo@gnu.org>
 ;;;
 ;;; This file is part of the GNU Guix web site.
 ;;;
@@ -93,7 +93,9 @@
 
    TAG (string)
      A tag as used by Haunt posts. For example: 'Scheme API'."
-  (url-path-join "blog" "tags" (slugify tag)))
+  ;; Note: End the path with a slash so 'localized-root-path' down the road
+  ;; prepends the language tag.
+  (url-path-join "blog" "tags" (slugify tag) ""))
 
 
 
diff --git a/website/tests/apps/blog/utils.scm 
b/website/tests/apps/blog/utils.scm
index c8784ba..0b6aa48 100644
--- a/website/tests/apps/blog/utils.scm
+++ b/website/tests/apps/blog/utils.scm
@@ -124,7 +124,7 @@
 
  (test-equal
   "Return the URL path to the tag."
-  "blog/tags/scheme-api"
+  "blog/tags/scheme-api/"
   (tag-url-path "Scheme API")))
 
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]