guix-commits
[Top][All Lists]
Advanced

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

branch master updated: hydra: goggles: Hide file extensions in the index


From: Tobias Geerinckx-Rice
Subject: branch master updated: hydra: goggles: Hide file extensions in the index.
Date: Mon, 16 Nov 2020 12:32:02 -0500

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

nckx pushed a commit to branch master
in repository maintenance.

The following commit(s) were added to refs/heads/master by this push:
     new 77a4e57  hydra: goggles: Hide file extensions in the index.
77a4e57 is described below

commit 77a4e575845d6c1573c630dde4f516b233332a70
Author: Andreas Enge <andreas@enge.fr>
AuthorDate: Mon Nov 16 18:24:16 2020 +0100

    hydra: goggles: Hide file extensions in the index.
    
    * hydra/goggles.scm (index): Define a DROP-EXTENSION procedure and use it.
---
 hydra/goggles.scm | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/hydra/goggles.scm b/hydra/goggles.scm
index f94f95e..4c4d91b 100755
--- a/hydra/goggles.scm
+++ b/hydra/goggles.scm
@@ -381,6 +381,11 @@ representation highlighting certain parts."
     (inner (proc (first files)) files))
 
 (define (index channel)
+  (define (drop-extension file-name)
+    (let ((dot (string-rindex file-name #\.)))
+      (if dot
+          (substring file-name 0 dot)
+          file-name)))
   (define (get-year file-name)
     (first (string-split file-name #\-)))
   (define (get-month file-name)
@@ -413,7 +418,8 @@ freenode." channel))
                               (h4 ,(get-month (first files)))
                               (ul
                                ,@(map (lambda (file)
-                                        `(li (a (@ (href ,(string-append "/" 
channel "/" file))) ,file)))
+                                        `(li (a (@ (href ,(string-append "/" 
channel "/" file)))
+                                                ,(drop-extension file))))
                                       files)))))
                          (group-by-month files)))))
              (group-by-year (channel-files channel)))))))



reply via email to

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