GNU bug report logs - #68194
[PATCH] website: Switch deprecated Haunt page objects to Haunt artifacts.

Previous Next

Package: guix-patches;

Reported by: sirgazil <at> zoho.com

Date: Mon, 1 Jan 2024 21:41:01 UTC

Severity: normal

Tags: patch

Done: "pelzflorian (Florian Pelz)" <pelzflorian <at> pelzflorian.de>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 68194 in the body.
You can then email your comments to 68194 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#68194; Package guix-patches. (Mon, 01 Jan 2024 21:41:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to sirgazil <at> zoho.com:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Mon, 01 Jan 2024 21:41:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: sirgazil <at> zoho.com
To: guix-patches <at> gnu.org
Cc: Luis Felipe <sirgazil <at> zoho.com>
Subject: [PATCH] website: Switch deprecated Haunt page objects to Haunt
 artifacts.
Date: Mon,  1 Jan 2024 16:39:37 -0500
From: Luis Felipe <sirgazil <at> zoho.com>

* website/apps/base/builder.scm (builder): Return a list of <artifact>s.
* website/apps/base/utils.scm (paginate): Likewise.
* website/apps/blog/builder.scm (builder): Likewise.
* website/apps/download/builder.scm (builder): Likewise.
* website/apps/media/builder.scm (builder): Likewise.
---
 website/apps/base/builder.scm     | 31 +++++++++++++++----------------
 website/apps/base/utils.scm       | 10 +++++-----
 website/apps/blog/builder.scm     | 27 ++++++++++++++-------------
 website/apps/download/builder.scm | 16 ++++++++++------
 website/apps/media/builder.scm    | 24 +++++++++++-------------
 5 files changed, 55 insertions(+), 53 deletions(-)

diff --git a/website/apps/base/builder.scm b/website/apps/base/builder.scm
index 492dc6b..8dd2108 100644
--- a/website/apps/base/builder.scm
+++ b/website/apps/base/builder.scm
@@ -18,9 +18,8 @@
   #:use-module (apps base types)
   #:use-module (apps blog utils)
   #:use-module (apps media data)
+  #:use-module (haunt artifact)
   #:use-module (haunt html)
-  #:use-module (haunt page)
-  #:use-module (haunt post)
   #:use-module (haunt utils)
   #:use-module (srfi srfi-1)
   #:export (builder))
@@ -43,9 +42,9 @@
      A list of post objects that represent articles from the blog. See
      Haunt <post> objects for more information.
 
-   RETURN (list of <page>)
-     A list of page objects that represent the web resources of the
-     application. See Haunt <page> objects for more information."
+   RETURN (list of <artifact>)
+     A list of artifacts that represent the web resources of the
+     application. See Haunt <artifact> type for more information."
   (flatten
    (list (menu-builder)
          (home-builder site posts)
@@ -67,40 +66,40 @@
 
 (define (about-builder)
   "Return a Haunt page representing the About page of the website."
-  (make-page "about/index.html" (about-t) sxml->html))
+  (serialized-artifact "about/index.html" (about-t) sxml->html))
 
 
 (define (contact-builder)
   "Return a Haunt page representing the Contact page of the website."
   (let ((context (list (cons "contact-media" contact-media))))
-    (make-page "contact/index.html" (contact-t context) sxml->html)))
+    (serialized-artifact "contact/index.html" (contact-t context) sxml->html)))
 
 
 (define (irc-builder)
   "Return a Haunt page with an embedded Kiwi IRC widget."
-  (make-page "contact/irc/index.html" (irc-t) sxml->html))
+  (serialized-artifact "contact/irc/index.html" (irc-t) sxml->html))
 
 
 (define (contribute-builder)
   "Return a Haunt page representing the Contribute page of the website."
-  (make-page "contribute/index.html" (contribute-t) sxml->html))
+  (serialized-artifact "contribute/index.html" (contribute-t) sxml->html))
 
 (define (cuirass-builder)
   "Return a Haunt page representing the Cuirass page of the website."
-  (make-page "cuirass/index.html" (cuirass-t) sxml->html))
+  (serialized-artifact "cuirass/index.html" (cuirass-t) sxml->html))
 
 (define (donate-builder)
   "Return a Haunt page representing the Donate page of the website."
-  (make-page "donate/index.html" (donate-t) sxml->html))
+  (serialized-artifact "donate/index.html" (donate-t) sxml->html))
 
 (define (graphics-builder)
   "Return a Haunt page representing the Graphics page of the website."
-  (make-page "graphics/index.html" (graphics-t) sxml->html))
+  (serialized-artifact "graphics/index.html" (graphics-t) sxml->html))
 
 
 (define (help-builder)
   "Return a Haunt page representing the Help page of the website."
-  (make-page "help/index.html" (help-t) sxml->html))
+  (serialized-artifact "help/index.html" (help-t) sxml->html))
 
 
 (define (home-builder site posts)
@@ -111,14 +110,14 @@
 	  (cons "posts" (posts/latest posts 3))
           (cons "contact-media" (list-head contact-media 3))
           (cons "videos" (take (reverse videos) 4)))))
-    (make-page "guix.html" (home-t context) sxml->html)))
+    (serialized-artifact "guix.html" (home-t context) sxml->html)))
 
 
 (define (menu-builder)
   "Return a Haunt page representing the website menu."
-  (make-page "menu/index.html" (menu-t) sxml->html))
+  (serialized-artifact "menu/index.html" (menu-t) sxml->html))
 
 
 (define (security-builder)
   "Return a Haunt page representing the Security page of the website."
-  (make-page "security/index.html" (security-t) sxml->html))
+  (serialized-artifact "security/index.html" (security-t) sxml->html))
diff --git a/website/apps/base/utils.scm b/website/apps/base/utils.scm
index 2762a8d..a45fad1 100644
--- a/website/apps/base/utils.scm
+++ b/website/apps/base/utils.scm
@@ -27,7 +27,7 @@
   #:use-module (apps aux system)
   #:use-module (apps base types)
   #:use-module (apps i18n)
-  #:use-module (haunt page)
+  #:use-module (haunt artifact)
   #:use-module (ice-9 i18n)
   #:use-module (ice-9 match)
   #:use-module (srfi srfi-1)
@@ -239,8 +239,8 @@ manual.
      A procedure that writes the page into a given format. See Haunt's
      'sxml->html' writer in the (haunt html) module, for example.
 
-   RETURN VALUE (list)
-     A list of <page> objects as defined in (haunt page) module."
+   RETURN VALUE (list of <artifact>)
+     A list of artifacts as defined in (haunt artifact) module."
   (let* ((grouped-data (list-group dataset limit))
 	 (total-pages (cons "total-pages" (length grouped-data))))
     ;; Read the following like (cons Page ListOfPages):
@@ -261,7 +261,7 @@ manual.
 	     (append context
 		     (list items page-number total-pages))))
 
-       (make-page path (template new-context) writer))
+       (serialized-artifact path (template new-context) writer))
      ;; ListOfPages
      ;; This is a list of pages that are the actual ordered pages
      ;; located in paths such as /blog/page/NUMBER/.
@@ -275,6 +275,6 @@ manual.
 	       (items (cons "items" (list-ref grouped-data index)))
 	       (new-context
 		(append context (list items page-number total-pages))))
-	  (make-page path (template new-context) writer)))
+	  (serialized-artifact path (template new-context) writer)))
 
       (iota (length grouped-data))))))
diff --git a/website/apps/blog/builder.scm b/website/apps/blog/builder.scm
index 7293401..eba92e6 100644
--- a/website/apps/blog/builder.scm
+++ b/website/apps/blog/builder.scm
@@ -12,7 +12,7 @@
   #:use-module (apps blog templates tag)
   #:use-module (apps blog utils)
   #:use-module (haunt html)
-  #:use-module (haunt page)
+  #:use-module (haunt artifact)
   #:use-module (haunt post)
   #:use-module (haunt site)
   #:use-module (haunt utils)
@@ -37,9 +37,9 @@
      A list of post objects that represent articles from the blog. See
      Haunt <post> objects for more information.
 
-   RETURN (list of <page>)
-     A list of page objects that represent the web resources of the
-     application. See Haunt <page> objects for more information."
+   RETURN (list of <artifact>)
+     A list of artifacts that represent the web resources of the
+     application. See Haunt <artifact> type for more information."
   (flatten
    (list
     (blog-feed-builder site posts)
@@ -75,9 +75,9 @@
 		 (if (> (length sorted-posts) max-posts)
 		     (list-head sorted-posts max-posts)
 		     sorted-posts)))))
-    (make-page (path-join "feeds" "blog.atom")
-	       (atom-feed-t context)
-	       sxml->xml*)))
+    (serialized-artifact (path-join "feeds" "blog.atom")
+	                 (atom-feed-t context)
+	                 sxml->xml*)))
 
 
 (define (post-list-builder posts)
@@ -98,9 +98,10 @@
   (map
    (lambda (post)
      (let ((context (list (cons "post" post))))
-       (make-page (path-join (post-url-path post) "index.html")
-		  (post-t context)
-		  sxml->html)))
+       (serialized-artifact
+        (path-join (post-url-path post) "index.html")
+	(post-t context)
+	sxml->html)))
    posts))
 
 
@@ -129,9 +130,9 @@
 						 ""))
 		(cons "posts"
 		      (posts/reverse-chronological (cdr tagged-posts))))))
-	 (make-page (path-join "feeds" "blog" file-name)
-		    (atom-feed-t context)
-		    sxml->xml)))
+	 (serialized-artifact (path-join "feeds" "blog" file-name)
+		              (atom-feed-t context)
+		              sxml->xml)))
      post-groups)))
 
 
diff --git a/website/apps/download/builder.scm b/website/apps/download/builder.scm
index cc983c5..986b6ef 100644
--- a/website/apps/download/builder.scm
+++ b/website/apps/download/builder.scm
@@ -7,7 +7,7 @@
   #:use-module (apps download templates download-latest)
   #:use-module (apps download data)
   #:use-module (haunt html)
-  #:use-module (haunt page)
+  #:use-module (haunt artifact)
   #:export (builder))
 
 
@@ -28,9 +28,9 @@
      A list of post objects that represent articles from the blog. See
      Haunt <post> objects for more information.
 
-   RETURN (list of <page>)
-     A list of page objects that represent the web resources of the
-     application. See Haunt <page> objects for more information."
+   RETURN (list of <artifact>)
+     A list of artifacts that represent the web resources of the
+     application. See Haunt <artifact> type for more information."
   (list (download-builder)
         (download-latest-builder)))
 
@@ -40,11 +40,15 @@
 ;;; Helper builders.
 ;;;
 (define (download-latest-builder)
-  (make-page "download/latest/index.html" (download-latest-t) sxml->html))
+  (serialized-artifact "download/latest/index.html"
+                       (download-latest-t)
+                       sxml->html))
 
 (define (download-builder)
   "Return a Haunt page representing the Download page of the website."
   (let ((context
 	 (list
 	  (cons "downloads" system-downloads))))
-    (make-page "download/index.html" (download-t context) sxml->html)))
+    (serialized-artifact "download/index.html"
+                         (download-t context)
+                         sxml->html)))
diff --git a/website/apps/media/builder.scm b/website/apps/media/builder.scm
index 7630713..9948c73 100644
--- a/website/apps/media/builder.scm
+++ b/website/apps/media/builder.scm
@@ -15,7 +15,6 @@
   #:use-module (apps media types)
   #:use-module (haunt artifact)
   #:use-module (haunt html)
-  #:use-module (haunt page)
   #:use-module (haunt utils)
   #:use-module (apps aux web)
   #:use-module (apps media utils)
@@ -40,10 +39,9 @@
      A list of post objects that represent articles from the blog. See
      Haunt <post> objects for more information.
 
-   RETURN (list of <artifact> and <page>)
-     A list of objects that represent the web resources of the
-     application. See Haunt <artifact> and <page> objects for more
-     information."
+   RETURN (list of <artifact>)
+     A list of artifacts that represent the web resources of the
+     application. See Haunt <artifact> type for more information."
   (flatten
    (list (publication-list-builder)
          (screenshots-overview-builder)
@@ -70,19 +68,19 @@
      (let ((context
             (list (cons "screenshot" shot)
                   (cons "screenshots" screenshots))))
-       (make-page (path-join "screenshots"
-                             (screenshot-slug shot)
-                             "index.html")
-                  (screenshot-t context)
-                  sxml->html)))
+       (serialized-artifact (path-join "screenshots"
+                                       (screenshot-slug shot)
+                                       "index.html")
+                            (screenshot-t context)
+                            sxml->html)))
    screenshots))
 
 
 (define (screenshots-overview-builder)
   "Return a Haunt page representing the screenshots overview page."
-  (make-page "screenshots/index.html"
-             (screenshots-overview-t screenshots)
-             sxml->html))
+  (serialized-artifact "screenshots/index.html"
+                       (screenshots-overview-t screenshots)
+                       sxml->html))
 
 (define (videos-builder)
   "Return a list whose elements can be single Haunt artifacts or lists

base-commit: b22555c98e2f2f911a61c1babdf883887c386065
-- 
2.41.0





Reply sent to "pelzflorian (Florian Pelz)" <pelzflorian <at> pelzflorian.de>:
You have taken responsibility. (Tue, 02 Jan 2024 17:56:01 GMT) Full text and rfc822 format available.

Notification sent to sirgazil <at> zoho.com:
bug acknowledged by developer. (Tue, 02 Jan 2024 17:56:02 GMT) Full text and rfc822 format available.

Message #10 received at 68194-done <at> debbugs.gnu.org (full text, mbox):

From: "pelzflorian (Florian Pelz)" <pelzflorian <at> pelzflorian.de>
To: sirgazil <at> zoho.com
Cc: 68194-done <at> debbugs.gnu.org
Subject: Re: [bug#68194] [PATCH] website: Switch deprecated Haunt page
 objects to Haunt artifacts.
Date: Tue, 02 Jan 2024 18:55:31 +0100
Untabified and pushed as e965b9423bf6307019b852106e68d42107781899.

Thank you sirgazil for ridding us of the deprecation warnings!

Regards,
Florian




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 31 Jan 2024 12:24:14 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 191 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.