[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
03/09: website: Refactor GUIX_WEB_SITE_ROOT_PATH handling.
From: |
Florian Pelz |
Subject: |
03/09: website: Refactor GUIX_WEB_SITE_ROOT_PATH handling. |
Date: |
Sun, 5 Jul 2020 04:21:31 -0400 (EDT) |
pelzflorian pushed a commit to branch wip-i18n
in repository guix-artwork.
commit 571815c7047f78c99e042980a4eb947ab778fecc
Author: Florian Pelz <pelzflorian@pelzflorian.de>
AuthorDate: Thu Oct 31 14:52:29 2019 +0100
website: Refactor GUIX_WEB_SITE_ROOT_PATH handling.
* website/apps/base/utils.scm (guix-url): Move the logic that
computes which root path to use from the getter to ...
(guix-root-url-path): ... the setter here.
---
website/apps/base/utils.scm | 22 ++++++++++++----------
1 file changed, 12 insertions(+), 10 deletions(-)
diff --git a/website/apps/base/utils.scm b/website/apps/base/utils.scm
index 281286e..946639e 100644
--- a/website/apps/base/utils.scm
+++ b/website/apps/base/utils.scm
@@ -47,11 +47,17 @@
(define guix-root-url-path
;; Path to GNU Guix site at guix.gnu.org.
- (make-parameter (or (getenv "GUIX_WEB_SITE_ROOT_PATH") "/")
- (lambda (path)
- (if (string-suffix? "/" path)
- path
- (string-append path "/")))))
+ (let ((path (cond
+ ;; If we are trying out the website locally, use "/" as the
root.
+ ((getenv "GUIX_WEB_SITE_LOCAL") "/")
+ (else (or (getenv "GUIX_WEB_SITE_ROOT_PATH") "/")))))
+ (make-parameter
+ path
+ ;; When setting guix-root-url-path, make it end in a slash.
+ (lambda (path)
+ (if (string-suffix? "/" path)
+ path
+ (string-append path "/"))))))
(define latest-guix-version
(make-parameter "1.1.0"))
@@ -97,11 +103,7 @@
RETURN VALUE (string)
A URL path. For example: /software/guix/packages/icecat-XYZ/."
- ;; If we are trying out the website locally, use "/" as the root.
- ;; Otherwise use guix-root-url-path for deployment to gnu.org.
- (if (getenv "GUIX_WEB_SITE_LOCAL")
- (string-append "/" subpath)
- (string-append (guix-root-url-path) subpath)))
+ (string-append (guix-root-url-path) subpath))
(define* (manual-url #:optional (subpath "")
- branch wip-i18n created (now 2fc2244), Florian Pelz, 2020/07/05
- 01/09: website: Fix building with GUIX_WEB_SITE_ROOT_PATH., Florian Pelz, 2020/07/05
- 03/09: website: Refactor GUIX_WEB_SITE_ROOT_PATH handling.,
Florian Pelz <=
- 02/09: website: Handle GUIX_WEB_SITE_ROOT_PATH not ending in a slash., Florian Pelz, 2020/07/05
- 04/09: website: Add custom xgettext to extract from nested sexps for i18n., Florian Pelz, 2020/07/05
- 05/09: website: apps: Mark all files for translation., Florian Pelz, 2020/07/05
- 09/09: website: Add language selection dropdown to navbar., Florian Pelz, 2020/07/05
- 06/09: website: media: Do not localize video page URLs., Florian Pelz, 2020/07/05
- 07/09: website: nls: Add German translation., Florian Pelz, 2020/07/05
- 08/09: website: navbar: Make dropdowns accessible to keyboard and touch input., Florian Pelz, 2020/07/05