guix-commits
[Top][All Lists]
Advanced

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

02/04: website: i18n: Decide more reliably when to rewrite URLs.


From: Florian Pelz
Subject: 02/04: website: i18n: Decide more reliably when to rewrite URLs.
Date: Wed, 30 Oct 2019 18:27:20 -0400 (EDT)

pelzflorian pushed a commit to branch wip-i18n
in repository guix-artwork.

commit 3f036823d893d345228da444683bc6215ada945e
Author: Florian Pelz <address@hidden>
Date:   Wed Oct 30 18:52:47 2019 +0000

    website: i18n: Decide more reliably when to rewrite URLs.
    
    * website/apps/i18n.scm (localize-url): Only rewrite URLs with / prefix.
---
 website/apps/i18n.scm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/website/apps/i18n.scm b/website/apps/i18n.scm
index ef85f9c..5bc0ddd 100644
--- a/website/apps/i18n.scm
+++ b/website/apps/i18n.scm
@@ -86,7 +86,7 @@
 (define* (localize-url url #:key (lingua %current-ietf-tag))
   "Given a URL as used in a href attribute, transforms it to point to
 the version for LINGUA as produced by builder->localized-builder."
-  (if (and (not (string-contains url "://"))
+  (if (and (string-prefix? "/" url)
            (or (string-suffix? ".html" url)
                (string-suffix? "/" url)))
       (string-append "/" lingua url)



reply via email to

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