guix-commits
[Top][All Lists]
Advanced

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

branch master updated: website: blog: Add standard XML header.


From: Ludovic Courtès
Subject: branch master updated: website: blog: Add standard XML header.
Date: Mon, 19 Dec 2022 10:07:42 -0500

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

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

The following commit(s) were added to refs/heads/master by this push:
     new c911b74  website: blog: Add standard XML header.
c911b74 is described below

commit c911b74918f14f0f5350c0e8afa12acd6264feb3
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Mon Dec 19 16:06:50 2022 +0100

    website: blog: Add standard XML header.
    
    Haunt 0.2.6 does the same.  Failing to add this header, the body may be
    interpreted with the wrong encoding.
    
    * website/apps/blog/builder.scm (sxml->xml*): New procedure.
    (blog-feed-builder): Use it.
---
 website/apps/blog/builder.scm | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/website/apps/blog/builder.scm b/website/apps/blog/builder.scm
index 8327645..c552aa8 100644
--- a/website/apps/blog/builder.scm
+++ b/website/apps/blog/builder.scm
@@ -54,6 +54,11 @@
 ;;; Helper builders.
 ;;;
 
+(define (sxml->xml* sxml port)                    ;from (haunt builder atom)
+  "Write SXML to PORT, preceded by an <?xml> tag."
+  (display "<?xml version=\"1.0\" encoding=\"utf-8\"?>" port)
+  (sxml->xml sxml port))
+
 (define (blog-feed-builder site posts)
   "Return a Haunt page representing the atom feed of the blog."
   (let* ((domain (site-domain site))
@@ -71,7 +76,7 @@
                     sorted-posts)))))
     (make-page (path-join "feeds" "blog.atom")
               (atom-feed-t context)
-              sxml->xml)))
+              sxml->xml*)))
 
 
 (define (post-list-builder posts)



reply via email to

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