guix-commits
[Top][All Lists]
Advanced

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

02/02: website: Handle multilingual tags in contact info for the front p


From: Ludovic Courtès
Subject: 02/02: website: Handle multilingual tags in contact info for the front page.
Date: Thu, 5 Apr 2018 08:26:54 -0400 (EDT)

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

commit d6a8bb20e0c7276fab7987f6c180926bd112c6c0
Author: Ludovic Courtès <address@hidden>
Date:   Thu Apr 5 14:24:58 2018 +0200

    website: Handle multilingual tags in contact info for the front page.
    
    * website/apps/base/templates/components.scm (contact-preview): Adjust
    to handle multilingual tags returned by 'contact-description'.
---
 website/apps/base/templates/components.scm | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/website/apps/base/templates/components.scm 
b/website/apps/base/templates/components.scm
index 39c836b..285d007 100644
--- a/website/apps/base/templates/components.scm
+++ b/website/apps/base/templates/components.scm
@@ -118,7 +118,14 @@
     (h3 ,(contact-name contact))
     (p
      ,(string-summarize
-       (sxml->string* (contact-description contact)) 30)
+       (sxml->string*
+        (match (contact-description contact)
+          ((and multilingual (((? string?) (? string?)) ...))
+           (match (assoc "en" multilingual)
+             (("en" blurb) blurb)))
+          (blurb
+           blurb)))
+       30)
      "…")))
 
 



reply via email to

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