[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
04/29: website: utils: 'paginate' correctly handles the case with zero i
From: |
Ludovic Courtès |
Subject: |
04/29: website: utils: 'paginate' correctly handles the case with zero items. |
Date: |
Wed, 6 Dec 2017 09:24:21 -0500 (EST) |
civodul pushed a commit to branch master
in repository guix-artwork.
commit 75af25bf40f5682427f33969e15066ba6adb6d8b
Author: Ludovic Courtès <address@hidden>
Date: Sat Jul 29 17:27:21 2017 +0200
website: utils: 'paginate' correctly handles the case with zero items.
* website/apps/base/utils.scm (paginate): Handle case when GROUPED-DATA
is empty.
---
website/apps/base/utils.scm | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/website/apps/base/utils.scm b/website/apps/base/utils.scm
index 39e4e82..e081652 100644
--- a/website/apps/base/utils.scm
+++ b/website/apps/base/utils.scm
@@ -27,6 +27,7 @@
#:use-module (apps base types)
#:use-module (haunt page)
#:use-module (ice-9 i18n)
+ #:use-module (ice-9 match)
#:use-module (srfi srfi-1)
#:export (gnu-url
guix-git-tree-url
@@ -175,7 +176,11 @@
(let* ((page-number (cons "page-number" 1))
(path (path-join base-path "index.html"))
(items
- (cons "items" (first grouped-data)))
+ (match grouped-data
+ (()
+ (cons "items" '()))
+ ((head _ ...)
+ (cons "items" head))))
(new-context
(append context
(list items page-number total-pages))))
- branch master updated (ae2d020 -> 81db25f), Ludovic Courtès, 2017/12/06
- 02/29: website: packages: Ignore third-party packages., Ludovic Courtès, 2017/12/06
- 04/29: website: utils: 'paginate' correctly handles the case with zero items.,
Ludovic Courtès <=
- 03/29: website: posts: Add missing tags and harmonize., Ludovic Courtès, 2017/12/06
- 05/29: website: packages: Implement grouping by letter., Ludovic Courtès, 2017/12/06
- 11/29: website: "download", not "test"., Ludovic Courtès, 2017/12/06
- 08/29: website: packages: Fix typo., Ludovic Courtès, 2017/12/06
- 07/29: website: packages: Add the commit in package source URLs., Ludovic Courtès, 2017/12/06
- 12/29: website: packages: Mark GNU packages in the listing., Ludovic Courtès, 2017/12/06
- 15/29: website: downloads: Change http to https in alpha.gnu.org URL., Ludovic Courtès, 2017/12/06
- 13/29: website: packages: Correctly compute supported systems., Ludovic Courtès, 2017/12/06
- 10/29: website: Use actual GuixSD screenshots., Ludovic Courtès, 2017/12/06
- 17/29: website: base: Change http to https in 'graphics'., Ludovic Courtès, 2017/12/06