From patchwork Mon Jan 1 21:39:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "ashish.is--- via Guix-patches\" via" X-Patchwork-Id: 58283 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id B75D427BBE9; Mon, 1 Jan 2024 21:41:19 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,SPF_HELO_PASS, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id D028D27BBE2 for ; Mon, 1 Jan 2024 21:41:16 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rKQ1u-0005kh-KF; Mon, 01 Jan 2024 16:41:02 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rKQ1s-0005kJ-LP for guix-patches@gnu.org; Mon, 01 Jan 2024 16:41:00 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rKQ1s-00052Z-B6 for guix-patches@gnu.org; Mon, 01 Jan 2024 16:41:00 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rKQ1t-0007iP-Q5 for guix-patches@gnu.org; Mon, 01 Jan 2024 16:41:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#68194] [PATCH] website: Switch deprecated Haunt page objects to Haunt artifacts. Resent-From: sirgazil@zoho.com Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 01 Jan 2024 21:41:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 68194 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 68194@debbugs.gnu.org Cc: Luis Felipe X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.170414522229601 (code B ref -1); Mon, 01 Jan 2024 21:41:01 +0000 Received: (at submit) by debbugs.gnu.org; 1 Jan 2024 21:40:22 +0000 Received: from localhost ([127.0.0.1]:48854 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rKQ1E-0007hM-WB for submit@debbugs.gnu.org; Mon, 01 Jan 2024 16:40:21 -0500 Received: from lists.gnu.org ([2001:470:142::17]:41166) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rKQ1C-0007h5-KN for submit@debbugs.gnu.org; Mon, 01 Jan 2024 16:40:19 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rKQ12-0005gI-81 for guix-patches@gnu.org; Mon, 01 Jan 2024 16:40:08 -0500 Received: from sender4-pp-o91.zoho.com ([136.143.188.91]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rKQ0z-0004eH-QY for guix-patches@gnu.org; Mon, 01 Jan 2024 16:40:07 -0500 Delivered-To: sirgazil@zoho.com ARC-Seal: i=1; a=rsa-sha256; t=1704145201; cv=none; d=zohomail.com; s=zohoarc; b=m2IkHGZ23CLLj/tW6IgataPXwH6r9Xw99CuKjpZeTBYgt7eL6aKQTIqKeyfI8dQT7RLFP/+XujW6VEm0gEzWu+tV2Z30X9so61kjiTx5I/hkfiqMb8AjVa6+lwdhLxm2cCe3DbOS1WHndqAKHw3jLFq4CxUpBvD4zBOLyLrQ+6o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704145201; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:MIME-Version:Message-ID:Subject:Subject:To:To:Message-Id:Reply-To; bh=zk8uHYSAsDaPmlJo35sPG+J6HaFmMucjqQhXgnjaPS8=; b=RK8KMXzVItJaxt2OcZmN22WEofsqThSrE1zmmSSklBS2kXbtF8PMetHRFNmTvi48Va2QrdSXvfGh5f1yc2XxKEmUF+JXu4Qva7IHbhpbya3NkelDjbxcEoiAQbF/kL+R1b18dyRVqNyIB943/BuvK4iDuxbE0zZQzztr76M3Xvw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=zoho.com; spf=pass smtp.mailfrom=sirgazil@zoho.com; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1704145201; s=zm2022; d=zoho.com; i=sirgazil@zoho.com; h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-ID:MIME-Version:Content-Transfer-Encoding:Feedback-ID:Message-Id:Reply-To; bh=zk8uHYSAsDaPmlJo35sPG+J6HaFmMucjqQhXgnjaPS8=; b=C8Nejg0iGIW2KRGxTxBR6TBMHaaPx2CU8e9H9pTogyTpUoMfRq9IMrgWEpli2t3c aFTwg67Um+KqhMumswSwraS1sQQUw8q5/gqh802YLddikvbYLtvQdrw8xOTSBYf9oEJ 76IVkgrbFVi0QaGAqLKIy4Sy2DpPaiCPhBsPrMSo= Received: from gnu.tigoune.com.co (191.95.156.233 [191.95.156.233]) by mx.zohomail.com with SMTPS id 1704145199571195.91569878224243; Mon, 1 Jan 2024 13:39:59 -0800 (PST) Date: Mon, 1 Jan 2024 16:39:37 -0500 Message-ID: <20240101213937.16003-1-sirgazil@zoho.com> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Feedback-ID: rr0801122788837f4db3989e3eb52d53390000214483aa2604cfb03a6620418fada17c49b9d537dd13439403:zu08011227964edf92c3a9fbb2eed1a94e0000116fcfab386c6d322a521efc09bdee74e4b442e2335e4403d6:rf08011226d3acc90840cd5fe6e6db97410000de8037f2a91598e61912af5b88ab16f1d8908af617f03de8:ZohoMail X-ZohoMailClient: External Received-SPF: pass client-ip=136.143.188.91; envelope-from=sirgazil@zoho.com; helo=sender4-pp-o91.zoho.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: sirgazil@zoho.com X-ACL-Warn: , sirgazil--- via Guix-patches X-Patchwork-Original-From: sirgazil--- via Guix-patches via From: "ashish.is--- via Guix-patches\" via" Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches From: Luis Felipe * website/apps/base/builder.scm (builder): Return a list of 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(-) base-commit: b22555c98e2f2f911a61c1babdf883887c386065 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 objects for more information. - RETURN (list of ) - A list of page objects that represent the web resources of the - application. See Haunt objects for more information." + RETURN (list of ) + A list of artifacts that represent the web resources of the + application. See Haunt 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 objects as defined in (haunt page) module." + RETURN VALUE (list of ) + 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 objects for more information. - RETURN (list of ) - A list of page objects that represent the web resources of the - application. See Haunt objects for more information." + RETURN (list of ) + A list of artifacts that represent the web resources of the + application. See Haunt 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 objects for more information. - RETURN (list of ) - A list of page objects that represent the web resources of the - application. See Haunt objects for more information." + RETURN (list of ) + A list of artifacts that represent the web resources of the + application. See Haunt 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 objects for more information. - RETURN (list of and ) - A list of objects that represent the web resources of the - application. See Haunt and objects for more - information." + RETURN (list of ) + A list of artifacts that represent the web resources of the + application. See Haunt 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