guix-commits
[Top][All Lists]
Advanced

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

03/03: website: Fix URLs.


From: Mathieu Lirzin
Subject: 03/03: website: Fix URLs.
Date: Mon, 11 May 2015 20:51:44 +0000

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

commit 35f094f1328a02e95dec2eee793dd99c5d642f32
Author: Mathieu Lirzin <address@hidden>
Date:   Fri May 8 04:56:17 2015 +0200

    website: Fix URLs.
    
    Enable local export to link URLs correctly.
    
    * website/www/utils.scm: New file.
    * website/www.scm (main-page): Use it.
    * website/www/about.scm (about-page): Likewise.
    * website/www/contribute.scm (contribute-page): Likewise.
    * website/www/donate.scm (donate-page): Likewise.
    * website/www/download.scm (download-page): Likewise.
    * website/www/help.scm (help-page): Likewise.
    * website/www/shared.scm (html-page-header, html-page-description)
      (html-page-links, html-page-footer): Likewise.
---
 website/www.scm            |   51 +++++++++++++++++++-------------------
 website/www/about.scm      |    7 +++--
 website/www/contribute.scm |   25 ++++++++++---------
 website/www/donate.scm     |   25 ++++++++++---------
 website/www/download.scm   |   19 +++++++-------
 website/www/help.scm       |   58 ++++++++++++++++++++++----------------------
 website/www/shared.scm     |   27 ++++++++++----------
 website/www/utils.scm      |   58 ++++++++++++++++++++++++++++++++++++++++++++
 8 files changed, 167 insertions(+), 103 deletions(-)

diff --git a/website/www.scm b/website/www.scm
index 36d7ee7..a6399bc 100644
--- a/website/www.scm
+++ b/website/www.scm
@@ -1,4 +1,5 @@
 (define-module (www)
+  #:use-module (www utils)
   #:use-module (www shared)
   #:use-module (www packages)
   #:use-module (www download)
@@ -27,21 +28,21 @@
                             "The Guix System Distribution")
                         (ul (li (b "Liberating.")
                                 " GuixSD is an advanced distribution of the "
-                                (a (@ (href "https://gnu.org/";)
+                                (a (@ (href ,(gnu-url ""))
                                       (class "hlink-yellow"))
                                    "GNU Operating System")
                                 " developed by the "
-                                (a (@ (href "https://gnu.org/";)
+                                (a (@ (href ,(gnu-url ""))
                                       (class "hlink-yellow"))
                                    "GNU Project ")
                                 "—which respects the "
-                                (a (@ (href 
"http://www.gnu.org/philosophy/free-sw.html";)
+                                (a (@ (href ,(gnu-url 
"philosophy/free-sw.html"))
                                       (class "hlink-yellow"))
                                    "freedom of computer users")
                                 ". ")
                             (li (b "Dependable.")
                                 " The "
-                                (a (@ (href "/software/guix/manual/")
+                                (a (@ (href ,(guix-url "manual"))
                                       (class "hlink-yellow"))
                                    "GNU Guix")
                                 " Package Manager, in addition to standard
@@ -49,17 +50,17 @@ package management features, supports transactional 
upgrades and roll-backs,
 unprivileged package management, per-user profiles, and garbage collection.")
                             (li (b "Hackable.")
                                 " It provides "
-                                (a (@ (href "https://www.gnu.org/s/guile/";)
+                                (a (@ (href ,(gnu-url "software/guile/"))
                                       (class "hlink-yellow"))
                                    "Guile Scheme")
                                 " APIs, including high-level embedded
 domain-specific languages (EDSLs), to describe how packages are built and
 composed."))
                         (div (@ (class "featured-actions"))
-                             (a (@ (href "/software/guix/download/")
+                             (a (@ (href ,(base-url "download"))
                                    (class "action download"))
                                 "TEST v0.8.2 (alpha)")
-                             (a (@ (href "/software/guix/contribute/")
+                             (a (@ (href ,(base-url "contribute"))
                                    (class "action contribute"))
                                 "CONTRIBUTE"))))
               (div (@ (id "discovery-box"))
@@ -67,15 +68,15 @@ composed."))
                    (div (@ (class "info-box text-center"))
                         (video (@ (src 
"http://audio-video.gnu.org/video/misc/2015-01__GNU_Guix__The_Emacs_of_Distros.webm";)
                                   (poster
-                                   
"/software/guix/static/base/img/the-emacs-of-distros.png")
+                                   ,(image-url "the-emacs-of-distros.png"))
                                   (controls "controls")
                                   (class "video-preview")))
                         (p "January 2015, The Emacs of Distros (48 minutes)")
-                        (p (a (@ (href "/software/guix/help/#talks")
+                        (p (a (@ (href ,(base-url "help/#talks"))
                                  (class "hlink-more-light"))
                               "Check all talks")))
                    (div (@ (class "info-box text-left"))
-                        (p (a (@ (href "/software/guix/manual/")
+                        (p (a (@ (href ,(guix-url "manual"))
                                  (class "hlink-yellow"))
                               "GNU Guix Documentation")
                            (br)
@@ -93,38 +94,38 @@ packaging API. ")
                               "GNU Manuals Online")
                            (br)
                            "Primary documentation for official GNU packages.")
-                        (p (a (@ (href "/software/guix/help/")
+                        (p (a (@ (href ,(base-url "help"))
                                  (class "hlink-more-light"))
                               "Find more documentation")))
-                   (img (@ (src 
"/software/guix/static/base/img/h-separator-darker.png")
+                   (img (@ (src ,(image-url "h-separator-darker.png"))
                            (class "h-separator")
                            (alt "")))
                    (div (@ (id "screens-box"))
-                        (a (@ (href 
"/software/guix/screenshots/0.8.2/grub-menu.png"))
-                           (img (@ (src 
"/software/guix/static/base/img/screenshots/grub-menu-thumb.png")
+                        (a (@ (href ,(screenshot-url "0.8.2" "grub-menu.png")))
+                           (img (@ (src ,(thumb-url "grub-menu-thumb.png"))
                                    (class "screenshot-thumb")
                                    (alt "GRUB menu"))))
-                        (a (@ (href 
"/software/guix/screenshots/0.8.2/slim.png"))
-                           (img (@ (src 
"/software/guix/static/base/img/screenshots/slim-thumb.png")
+                        (a (@ (href ,(screenshot-url "0.8.2" "slim.png")))
+                           (img (@ (src ,(thumb-url "slim-thumb.png"))
                                    (class "screenshot-thumb")
                                    (alt "Slim login manager"))))
-                        (a (@ (href 
"/software/guix/screenshots/0.8.2/windowmaker+icecat+inkscape.png"))
-                           (img (@ (src 
"/software/guix/static/base/img/screenshots/windowmaker+icecat+inkscape-thumb.png")
+                        (a (@ (href ,(screenshot-url "0.8.2" 
"windowmaker+icecat+inkscape.png")))
+                           (img (@ (src ,(thumb-url 
"windowmaker+icecat+inkscape-thumb.png"))
                                    (class "screenshot-thumb")
                                    (alt "Windowmaker, Icecat, and Inkscape"))))
-                        (a (@ (href 
"/software/guix/screenshots/0.8.2/user-interfaces.png"))
-                           (img (@ (src 
"/software/guix/static/base/img/screenshots/user-interfaces-thumb.png")
+                        (a (@ (href ,(screenshot-url "0.8.2" 
"user-interfaces.png")))
+                           (img (@ (src ,(thumb-url 
"user-interfaces-thumb.png"))
                                    (class "screenshot-thumb")
                                    (alt "mplayer and xterm"))))
-                        (a (@ (href 
"/software/guix/screenshots/0.8.2/emacs-ui-packages.png"))
-                           (img (@ (src 
"/software/guix/static/base/img/screenshots/emacs-ui-packages-thumb.png")
+                        (a (@ (href ,(screenshot-url "0.8.2" 
"emacs-ui-packages.png")))
+                           (img (@ (src ,(thumb-url 
"emacs-ui-packages-thumb.png"))
                                    (class "screenshot-thumb")
                                    (alt "Emacs user interface to the package 
manager."))))
-                        (a (@ (href 
"/software/guix/screenshots/0.8.2/emacs-ui-generations.png"))
-                           (img (@ (src 
"/software/guix/static/base/img/screenshots/emacs-ui-generations-thumb.png")
+                        (a (@ (href ,(screenshot-url "0.8.2" 
"emacs-ui-generations.png")))
+                           (img (@ (src ,(thumb-url 
"emacs-ui-generations-thumb.png"))
                                    (class "screenshot-thumb")
                                    (alt "Emacs user interface 
generations.")))))
-                   (p (a (@ (href "/software/guix/contribute/")
+                   (p (a (@ (href ,(base-url "contribute") )
                             (class "hlink-yellow-boxed"))
                          "Help us package more software →")))
               (div (@ (id "news-box"))
diff --git a/website/www/about.scm b/website/www/about.scm
index 128041d..ce48638 100644
--- a/website/www/about.scm
+++ b/website/www/about.scm
@@ -1,4 +1,5 @@
 (define-module (www about)
+  #:use-module (www utils)
   #:use-module (www shared)
   #:export (about-page))
 
@@ -17,7 +18,7 @@
                   (em "GNU Guix")
                   " package manager are free software projects developed by
 the "
-                  (a (@ (href "http://www.gnu.org/";))
+                  (a (@ (href ,(gnu-url "")))
                      "GNU Project")
                   " and independent volunteers from various parts of the
 world. This is the official website for both projects. ")
@@ -30,7 +31,7 @@ understand the concept, you should think of \"free\" as in 
\"free speech\", not
 as in \"free beer\". ")
                 (p "More precisely, free software means users of a program have
 the "
-                   (a (@ (href "/philosophy/free-sw.html"))
+                   (a (@ (href ,(gnu-url "philosophy/free-sw.html")))
                       "four essential freedoms")
                    ":")
                 (ul (li "The freedom to run the program as you wish, for any
@@ -52,7 +53,7 @@ Courtès. Please use the "
                (h2 (@ (id "license")) "Licensing")
                (p "Guix is free software; you can redistribute it and/or modify
 it under the terms of the "
-                  (a (@ (rel "license") (href "/licenses/gpl.html"))
+                  (a (@ (rel "license") (href ,(gnu-url "licenses/gpl.html")))
                      "GNU General Public License")
                   " as published by the Free Software Foundation; either
 version\xa03 of the License, or (at your option) any later version. ")
diff --git a/website/www/contribute.scm b/website/www/contribute.scm
index 076412a..b1e4b93 100644
--- a/website/www/contribute.scm
+++ b/website/www/contribute.scm
@@ -1,4 +1,5 @@
 (define-module (www contribute)
+  #:use-module (www utils)
   #:use-module (www shared)
   #:export (contribute-page))
 
@@ -53,7 +54,7 @@ the project is available in the "
                          (h2 (@ (id "documentation"))
                              "Documentation")
                          (p "You can read the "
-                            (a (@ (href "/software/guix/help/"))
+                            (a (@ (href ,(base-url "help")))
                                "project documentation")
                             " already available in the system and in the
 website, and help us identify any errors or omissions. Creating new manuals,
@@ -61,7 +62,7 @@ tutorials, and blog entries will also help users and 
developers discover what we
 do. ")
                          (p "Helping improve the documentation of
 the "
-                            (a (@ (href "/software/guix/packages/"))
+                            (a (@ (href ,(base-url "packages")))
                                "packaged software")
                             " is another way to contribute. ")
                          (a (@ (href 
"http://lists.gnu.org/mailman/listinfo/guix-devel";)
@@ -74,7 +75,7 @@ need to be packaged to make it easier for users to install 
their favorite tools
 with the Guix package manager, and be productive using the system. ")
                          (p "Information on how to add packages to the
 distribution can be found "
-                            (a (@ (href 
"/software/guix/manual/guix.html#Packaging-Guidelines"))
+                            (a (@ (href ,(guix-url 
"manual/guix.html#Packaging-Guidelines")))
                                "in the manual")
                             ". ")
                          (a (@ (href 
"http://lists.gnu.org/mailman/listinfo/guix-devel";)
@@ -83,15 +84,15 @@ distribution can be found "
                     (div (@ (class "summary-box"))
                          (h2 (@ (id "programming")) "Programming")
                          (p "We use "
-                            (a (@ (href "/software/guile/"))
+                            (a (@ (href ,(gnu-url "software/guile")))
                                "GNU Guile")
                             " as the main programming and extension language
 for the components of the system. ")
                          (p "You will find it useful to browse the "
-                            (a (@ (href "/software/guile/manual"))
+                            (a (@ (href ,(gnu-url "software/guile/manual")))
                                "Guile's manual")
                             " or other "
-                            (a (@ (href 
"http://schemers.org/Documents/#intro-texts";))
+                            (a (@ (href 
"https://schemers.org/Documents/#intro-texts";))
                                "introductory material about Scheme")
                             ". Also, make sure to read the "
                             (a (@ (href 
"http://git.savannah.gnu.org/cgit/guix.git/tree/HACKING";))
@@ -109,7 +110,7 @@ all the contributors to communicate and collaborate in the 
project, and users to
 be able to download and install packages. Help us keep the system up and 
running
 smoothly. ")
                          (p "You can also "
-                            (a (@ (href "/software/guix/donate/"))
+                            (a (@ (href ,(base-url "donate")))
                                "donate hardware or hosting")
                             ". ")
                          (a (@ (href 
"http://lists.gnu.org/mailman/listinfo/guix-devel";)
@@ -122,10 +123,10 @@ smoothly. ")
 community about your experience. Help the project reporting bugs.")
                          (p "Before reporting a bug, please check whether the
 bug is already "
-                            (a (@ (href "http://debbugs.gnu.org/guix";))
+                            (a (@ (href "https://debbugs.gnu.org/guix";))
                                "in the bug database")
                             ". See "
-                            (a (@ (href 
"http://debbugs.gnu.org/Developer.html";))
+                            (a (@ (href 
"https://debbugs.gnu.org/Developer.html";))
                                "the developer information page")
                             " for more information on how to manipulate bug
 reports. ")
@@ -137,15 +138,15 @@ reports. ")
                          (p "You can help us translate software and
 documentation to your language. The main components of the Guix System
 Distribution, including the Guix package manager, can be translated in the "
-                            (a (@ (href "http://translationproject.org/";))
+                            (a (@ (href "https://translationproject.org/";))
                                "Translation Project")
                             ".")
                          (p "Other "
-                            (a (@ (href "/software/guix/packages/"))
+                            (a (@ (href ,(base-url "packages")))
                                "software packaged")
                             " for the system may have their own translation
 tools. Visit their websites and help translate. ")
-                         (a (@ (href "http://translationproject.org/";)
+                         (a (@ (href "https://translationproject.org/";)
                                (class "hlink-more-dark"))
                             "Start translating")))
                (h2 (@ (id "resources"))
diff --git a/website/www/donate.scm b/website/www/donate.scm
index 5ded10a..e238444 100644
--- a/website/www/donate.scm
+++ b/website/www/donate.scm
@@ -1,4 +1,5 @@
 (define-module (www donate)
+  #:use-module (www utils)
   #:use-module (www shared)
   #:export (donate-page))
 
@@ -17,7 +18,7 @@
                   " of the Guix System Distribution runs on donated hardware
 and hosting. Please consider helping the project with donations. ")
                (p "As the distribution grows (see the "
-                  (a (@ (href "/software/guix/packages/"))
+                  (a (@ (href ,(base-url "packages")))
                      "package list")
                   "), so do the computing and storage needs. We are looking for
 donations of hardware and optionally hosting for the following kinds of
@@ -31,9 +32,9 @@ binaries for the "
                        ";")
                    (li "mips64el machines to strengthen this port."))
                (p "Please get in touch with us through the "
-                  (a (@ (href "/software/guix/about/#contact"))
+                  (a (@ (href ,(base-url "about/#contact")))
                      "usual channels")
-                  "or using the address@hidden private alias to discuss
+                  " or using the address@hidden private alias to discuss
 any opportunities. ")
                (h2 (@ (id "hardware-donors")) "Thanks to the donors!")
                (p "The table below summarizes hardware and hosting donations
@@ -47,23 +48,23 @@ reality.")
                                  (th "donors")))
                       (tbody (tr (td "hydra.gnu.org")
                                  (td "build farm front-end")
-                                 (td (ul (li (a (@ (href 
"http://www.fsf.org/";))
-                                                "Free Software \t          
Foundation")))))
+                                 (td (ul (li (a (@ (href 
"https://www.fsf.org/";))
+                                                "Free Software Foundation")))))
                              (tr (td "hydra.gnunet.org")
                                  (td "x86_64-linux, i686-linux")
                                  (td (ul (li (a (@ (href 
"https://gnunet.org/fsnsg";))
-                                                "Free Secure
-Network Systems Group")
+                                                "Free Secure Network Systems
+Group")
                                              " at the "
-                                             (a (@ (href "http://www.tum.de/";))
-                                                "Technische
-Universität München")))))
+                                             (a (@ (href 
"https://www.tum.de/";))
+                                                "Technische Universität
+München")))))
                              (tr (td "chapters.gnu.org")
                                  (td "x86_64-linux, i686-linux")
-                                 (td (ul (li (a (@ (href "http://es.gnu.org";))
+                                 (td (ul (li (a (@ (href "https://es.gnu.org";))
                                                 "GNU\xa0España")
                                              " (hardware)")
-                                         (li (a (@ (href 
"http://fsffrance.org/index.en.html";))
+                                         (li (a (@ (href 
"https://fsffrance.org/index.en.html";))
                                                 "FSF\xa0France")
                                              " (hosting)"))))
                              (tr (td "wildebeest")
diff --git a/website/www/download.scm b/website/www/download.scm
index 35a86ec..cc4aae9 100644
--- a/website/www/download.scm
+++ b/website/www/download.scm
@@ -1,4 +1,5 @@
 (define-module (www download)
+  #:use-module (www utils)
   #:use-module (www shared)
   #:export (download-page))
 
@@ -12,20 +13,20 @@
               (article
                (h1 "Download")
                (p "As of version 0.8.1, the Guix System Distribution "
-                  (a (@ (href 
"/software/guix/manual/html_node/System-Installation.html"))
+                  (a (@ (href ,(guix-url 
"manual/html_node/System-Installation.html")))
                      "can be installed")
                   " on an i686 or x86_64 machine. It uses the "
-                  (a (@ (href "/software/linux-libre"))
+                  (a (@ (href ,(gnu-url "software/linux-libre")))
                      "Linux-Libre")
                   " kernel and the "
-                  (a (@ (href "/software/dmd")) "GNU dmd")
+                  (a (@ (href ,(gnu-url "software/dmd"))) "GNU dmd")
                   " init system. Alternately, its package manager, GNU Guix,
 can be installed as an additional package manager on top of an installed
 Linux-based system.")
                (div (@ (class "text-center"))
                     (div (@ (class "summary-box"))
                          (div (@ (class "text-center"))
-                              (img (@ (src 
"/software/guix/static/base/img/GuixSD-package.png")
+                              (img (@ (src ,(image-url "GuixSD-package.png"))
                                       (alt ""))))
                          (h2 "GuixSD 0.8.2 (i686)")
                          (p "USB installer for machines with the following
@@ -47,7 +48,7 @@ minimum system requirements:")
                             (br)
                             (a (@ (href "#")) "Get signature"))
                          (p "See the "
-                            (a (@ (href 
"/software/guix/manual/html_node/System-Installation.html"))
+                            (a (@ (href ,(guix-url 
"manual/html_node/System-Installation.html")))
                                "installation instructions")
                             " from the manual.")
                          (p "Alternative download methods: "
@@ -55,7 +56,7 @@ minimum system requirements:")
                             "."))
                     (div (@ (class "summary-box"))
                          (div (@ (class "text-center"))
-                              (img (@ (src 
"/software/guix/static/base/img/GuixSD-package.png")
+                              (img (@ (src ,(image-url "GuixSD-package.png"))
                                       (alt ""))))
                          (h2 "GuixSD 0.8.2 (x86_64)")
                          (p "USB installer for machines with the following
@@ -77,7 +78,7 @@ minimum system requirements:")
                             (br)
                             (a (@ (href "#")) "Get signature"))
                          (p "See the "
-                            (a (@ (href 
"/software/guix/manual/html_node/System-Installation.html"))
+                            (a (@ (href ,(guix-url 
"manual/html_node/System-Installation.html")))
                                "installation instructions")
                             " from the manual.")
                          (p "Alternative download methods: "
@@ -85,7 +86,7 @@ minimum system requirements:")
                             "."))
                     (div (@ (class "summary-box"))
                          (div (@ (class "text-center"))
-                              (img (@ (src 
"/software/guix/static/base/img/Guix-package.png")
+                              (img (@ (src ,(image-url "Guix-package.png"))
                                       (alt ""))))
                          (h2 "GNU Guix 0.8.2")
                          (p "Archive distribution to install from source on
@@ -107,7 +108,7 @@ machines with the following minimum system requirements:")
                             (br)
                             (a (@ (href "#")) "Get signature"))
                          (p "See the "
-                            (a (@ (href 
"/software/guix/manual/html_node/System-Installation.html"))
+                            (a (@ (href ,(guix-url 
"manual/html_node/System-Installation.html")))
                                " installation instructions")
                             " from the manual.")
                          (p "Alternative download methods: "
diff --git a/website/www/help.scm b/website/www/help.scm
index 0899ebc..3c42b9e 100644
--- a/website/www/help.scm
+++ b/website/www/help.scm
@@ -1,4 +1,5 @@
 (define-module (www help)
+  #:use-module (www utils)
   #:use-module (www shared)
   #:export (help-page))
 
@@ -14,43 +15,42 @@
                (div (@ (class "text-center"))
                     (div (@ (class "summary-box"))
                          (div (@ (class "text-center"))
-                              (img (@ (src 
"/software/guix/static/base/img/guixsd-manual-icon.png")
+                              (img (@ (src ,(image-url 
"guixsd-manual-icon.png"))
                                       (alt ""))))
                          (h2 "GuixSD Manual")
                          (p "The documentation about the Guix System
 Distribution is available online as part of the GNU Guix package manager
 manual.")
-                         (a (@ (href 
"/software/guix/manual/guix.html#GNU-Distribution")
+                         (a (@ (href ,(guix-url 
"manual/guix.html#GNU-Distribution"))
                                (class "hlink-more-dark"))
                             "Read the manual"))
                     (div (@ (class "summary-box"))
                          (div (@ (class "text-center"))
-                              (img (@ (src 
"/software/guix/static/base/img/guix-manual-icon.png")
+                              (img (@ (src ,(image-url "guix-manual-icon.png"))
                                       (alt ""))))
                          (h2 "GNU Guix Manual")
                          (p "Documentation for the GNU Guix package manager is
 available online. You may also find more information about Guix by running "
                             (em "info\xa0guix")
                             ".")
-                         (a (@ (href "/software/guix/manual/")
+                         (a (@ (href ,(guix-url "manual"))
                                (class "hlink-more-dark"))
                             "Read the manual"))
                     (div (@ (class "summary-box"))
                          (div (@ (class "text-center"))
-                              (img (@ (src 
"/software/guix/static/base/img/library-icon.png")
+                              (img (@ (src ,(image-url "library-icon.png"))
                                       (alt ""))))
                          (h2 "GNU Manuals")
                          (p "GuixSD is a distribution of the "
-                            (a (@ (href "http://www.gnu.org/";))
-                               "GNU operating system")
+                            (a (@ (href ,(gnu-url ""))) "GNU operating system")
                             ". Most GNU software is documented and the
 documentation is available online in various formats. ")
-                         (a (@ (href "http://www.gnu.org/doc/doc.en.html";)
+                         (a (@ (href ,(gnu-url "doc/doc.en.html"))
                                (class "hlink-more-dark"))
                             "Browse the manuals"))
                     (div (@ (class "summary-box"))
                          (div (@ (class "text-center"))
-                              (img (@ (src 
"/software/guix/static/base/img/chat-icon.png")
+                              (img (@ (src ,(image-url "chat-icon.png"))
                                       (alt ""))))
                          (h2 "IRC Chat")
                          (p "For real-time support from the community, you can
@@ -65,12 +65,12 @@ browsed online. See the "
                             (a (@ (href "https://gnunet.org/bot/log/guix/";))
                                "channel logs")
                             ". ")
-                         (a (@ (href 
"http://webchat.freenode.net/?channels=%23guix";)
+                         (a (@ (href 
"https://webchat.freenode.net/?channels=%23guix";)
                                (class "hlink-more-dark"))
                             "Connect"))
                     (div (@ (class "summary-box"))
                          (div (@ (class "text-center"))
-                              (img (@ (src 
"/software/guix/static/base/img/email-icon.png")
+                              (img (@ (src ,(image-url "email-icon.png"))
                                       (alt ""))))
                          (h2 "Mailing lists")
                          (p "Email support from the community is also available
@@ -98,10 +98,10 @@ Distribution. ")
                                (class "hlink-more-dark"))
                             "Check all the lists")))
                (h2 "Additional Documentation")
-               (ul (li (a (@ (href "http://arxiv.org/abs/1305.4584";))
+               (ul (li (a (@ (href "https://arxiv.org/abs/1305.4584";))
                           (i "Functional Package Management with Guix"))
                        ", presented at the "
-                       (a (@ (href 
"http://www-sop.inria.fr/members/Manuel.Serrano/conferences/els13.html";))
+                       (a (@ (href 
"https://www-sop.inria.fr/members/Manuel.Serrano/conferences/els13.html";))
                           "2013 European Lisp Symposium (ELS)")
                        ", describes the rationale, design, and
 implementation of Guix's packaging API. \t "))
@@ -110,24 +110,24 @@ implementation of Guix's packaging API. \t "))
                        (a (@ (href 
"https://fosdem.org/2015/schedule/event/the_emacs_of_distros/";))
                           "FOSDEM")
                        ": "
-                       (a (@ (href "guix-fosdem-20150131.pdf"))
+                       (a (@ (href ,(slides-url "guix-fosdem-20150131.pdf")))
                           "slides")
                        ", "
-                       (a (@ (href 
"http://audio-video.gnu.org/video/misc/2015-01__GNU_Guix__The_Emacs_of_Distros.webm";))
+                       (a (@ (href 
"https://audio-video.gnu.org/video/misc/2015-01__GNU_Guix__The_Emacs_of_Distros.webm";))
                           "video")
                        " (WebM; 47 minutes) ")
                    (li "August 2014, "
-                       (a (@ (href 
"http://audio-video.gnu.org/video/ghm2014/";))
+                       (a (@ (href 
"https://audio-video.gnu.org/video/ghm2014/";))
                           "GNU Hackers Meeting")
                        ": "
-                       (a (@ (href "guix-ghm-20140815.pdf"))
+                       (a (@ (href ,(slides-url "guix-ghm-20140815.pdf")))
                           "slides")
                        ", "
-                       (a (@ (href 
"http://audio-video.gnu.org/video/ghm2014/2014-08--courtes--were-building-the-gnu-system--ghm.webm";))
+                       (a (@ (href 
"https://audio-video.gnu.org/video/ghm2014/2014-08--courtes--were-building-the-gnu-system--ghm.webm";))
                           "video")
                        " (WebM; 60 minutes) ")
                    (li "July 2014, "
-                       (a (@ (href 
"http://www.open-bio.org/wiki/Codefest_2014";))
+                       (a (@ (href 
"https://www.open-bio.org/wiki/Codefest_2014";))
                           "Open Bioinformatics Codefest 2014")
                        ": "
                        (a (@ (href "guix-openbio-codefest-20140709.pdf"))
@@ -136,46 +136,46 @@ implementation of Guix's packaging API. \t "))
                        (a (@ (href 
"https://fosdem.org/2014/schedule/event/gnuguix/";))
                           "FOSDEM")
                        ": "
-                       (a (@ (href "guix-fosdem-20140201.pdf"))
+                       (a (@ (href ,(slides-url "guix-fosdem-20140201.pdf")))
                           "slides")
                        ", "
-                       (a (@ (href 
"http://video.fosdem.org/2014/H1302_Depage/Sunday/Growing_a_GNU_with_Guix.webm";))
+                       (a (@ (href 
"https://video.fosdem.org/2014/H1302_Depage/Sunday/Growing_a_GNU_with_Guix.webm";))
                           "video")
                        " (WebM; 55 minutes) ")
                    (li "August 2013, "
-                       (a (@ (href "/ghm/2013/paris"))
+                       (a (@ (href ,(gnu-url "ghm/2013/paris")))
                           "GNU Hackers Meeting")
                        (ul (li (i "GNU Guix: Package without a
 scheme!")
                                ", by Andreas: "
-                               (a (@ (href "guix-ghm-andreas-20130823.pdf"))
+                               (a (@ (href ,(slides-url 
"guix-ghm-andreas-20130823.pdf")))
                                   "slides"))
                            (li (i "Guix, the Computing Freedom
 Deployment Tool")
                                ", by Ludovic: "
-                               (a (@ (href "guix-ghm-ludo-20130823.pdf"))
+                               (a (@ (href ,(slides-url 
"guix-ghm-ludo-20130823.pdf")))
                                   "slides")
                                ", "
                                (a (@ (href 
"http://audio-video.gnu.org/video/ghm2013/Ludovic_Courtes-GNU_Guix_the_computing_freedom_deployment_tool_.webm";))
                                   "video")
                                " (WebM; 60 minutes, 127MB) ")))
                    (li "June 2013, "
-                       (a (@ (href 
"http://www-sop.inria.fr/members/Manuel.Serrano/conferences/els13.html";))
+                       (a (@ (href 
"https://www-sop.inria.fr/members/Manuel.Serrano/conferences/els13.html";))
                           " European Lisp Symposium (ELS)")
                        ": "
-                       (a (@ (href "guix-els-20130603.pdf"))
+                       (a (@ (href ,(slides-url "guix-els-20130603.pdf")))
                           "slides")
                        ", "
                        (a (@ (href 
"http://www.nicklevine.org/els2013/ludovic-courtes.mp3";))
                           "audio"))
                    (li "July 2012, "
-                       (a (@ (href "/ghm/2012/ddorf/"))
+                       (a (@ (href ,(gnu-url "ghm/2012/ddorf")))
                           "GNU Hackers Meeting")
                        ": "
-                       (a (@ (href "guix-ghm-20120721.pdf"))
+                       (a (@ (href ,(slides-url "guix-ghm-20120721.pdf")))
                           "slides")
                        ", "
-                       (a (@ (href 
"http://audio-video.gnu.org/video/ghm2012/guix.ogv";))
+                       (a (@ (href 
"https://audio-video.gnu.org/video/ghm2012/guix.ogv";))
                           "video")
                        " (Ogg/"
                        (a (@ (href "http://theora.org/";)) "Theora")
diff --git a/website/www/shared.scm b/website/www/shared.scm
index 8156f9d..37c2c99 100644
--- a/website/www/shared.scm
+++ b/website/www/shared.scm
@@ -1,4 +1,5 @@
 (define-module (www shared)
+  #:use-module (www utils)
   #:export (html-page-header
            html-page-description
            html-page-links
@@ -23,13 +24,13 @@ GUix Package Manager, Guile Scheme, Functional package 
management")))
                  (content "width=device-width, initial-scale=1.0")))
         (link (@ (type "text/css")
                  (rel "stylesheet")
-                 (href "/software/guix/static/base/css/base.css")))
+                 (href ,(css-url "base.css"))))
         (link (@ (type "text/css")
                  (rel "stylesheet")
-                 (href "/software/guix/static/base/css/index.css")))
+                 (href ,(css-url "index.css"))))
         (link (@ (type "image/png")
                  (rel "icon")
-                 (href "/software/guix/static/base/img/favicon.png")))
+                 (href ,(image-url "favicon.png"))))
         (link (@ (rel "license") (href "Pending...")))
         (title ,(string-append title " - GuixSD"))))
 
@@ -39,26 +40,26 @@ GUix Package Manager, Guile Scheme, Functional package 
management")))
        "The Guix System Distribution (GuixSD) is alpha software. This means it
 is not production-ready. It may contain bugs and lack important features. But
 more than a disclaimer, this is an invitation to join us in improving it. See "
-       (a (@ (href "/software/guix/contribute/")) "Contributing")
+       (a (@ (href ,(base-url "contribute"))) "Contributing")
        ", for more information. We hope you can soon switch to GuixSD without
 fear. "))
 
 (define (html-page-links)
   `(div (@ (id "header-box"))
-       (a (@ (id "logo") (href "/software/guix/"))
-          (img (@ (src "/software/guix/static/base/img/GuixSD-logo.png")
+       (a (@ (id "logo") (href ,(base-url "")))
+          (img (@ (src ,(image-url "GuixSD-logo.png"))
                   (alt "GuixSD"))))
        (ul (@ (id "site-nav"))
-           (li (a (@ (href "/software/guix/download/")) "Download"))
-           (li (a (@ (href "/software/guix/package-list.html")) "Packages"))
-           (li (a (@ (href "/software/guix/help/")) "Help"))
-           (li (a (@ (href "/software/guix/contribute/")) "Contribute"))
-           (li (a (@ (href "/software/guix/donate/")) "Donate"))
-           (li (a (@ (href "/software/guix/about/")) "About")))))
+           (li (a (@ (href ,(base-url "download"))) "Download"))
+           (li (a (@ (href ,(guix-url "package-list.html"))) "Packages"))
+           (li (a (@ (href ,(base-url "help"))) "Help"))
+           (li (a (@ (href ,(base-url "contribute"))) "Contribute"))
+           (li (a (@ (href ,(base-url "donate"))) "Donate"))
+           (li (a (@ (href ,(base-url "about"))) "About")))))
 
 (define (html-page-footer)
   `(div (@ (id "footer-box"))
        "copyleft 2015 GuixSD "
-       (a (@ (href "/software/guix/contribute/") (class "hlink-yellow"))
+       (a (@ (href ,(base-url "contribute")) (class "hlink-yellow"))
           "Contributors")
        ". Made with " (span (@ (class "metta")) "♥") " by humans."))
diff --git a/website/www/utils.scm b/website/www/utils.scm
new file mode 100644
index 0000000..e12eabd
--- /dev/null
+++ b/website/www/utils.scm
@@ -0,0 +1,58 @@
+(define-module (www utils)
+  #:export (current-url-root
+           gnu.org-root
+
+           base-url
+           gnu-url
+           guix-url
+           static-base-url
+           css-url
+           image-url
+           thumb-url
+           screenshot-url
+           slides-url))
+
+
+;;;
+;;; URL variables.
+;;;
+
+(define current-url-root
+  ;; Website local url prefix.
+  (make-parameter "/software/guix"))
+
+(define gnu.org-root
+  ;; GNU's website url prefix.
+  (make-parameter ""))
+
+
+;;;
+;;; URL linking.
+;;;
+
+(define (base-url location)
+  (string-append (current-url-root) "/" location))
+
+(define (gnu-url location)
+  (string-append (gnu.org-root) "/" location))
+
+(define (guix-url location)
+  (string-append (gnu-url "software/guix/") location))
+
+(define (static-base-url)
+  (base-url "static/base/"))
+
+(define (css-url file)
+  (string-append (static-base-url) "css/" file))
+
+(define (image-url file)
+  (string-append (static-base-url) "img/" file))
+
+(define (thumb-url file)
+  (string-append (image-url "screenshots/") file))
+
+(define (screenshot-url version file)
+  (string-append (guix-url "screenshots/") version "/" file))
+
+(define (slides-url file)
+  (guix-url file))



reply via email to

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