From 6b45fdc35a5e831656dcc106b67cd3f6b45e0285 Mon Sep 17 00:00:00 2001 From: Eric Somdahl Date: Tue, 10 Mar 2015 21:29:04 -0400 Subject: [PATCH] Modification to allow the generated rss xml to pass xsd validation. 1) Removed the tag from each . The presence of this tag is ok here but the xsd requires that the content include a valid email address, not just the name string coming from the site config (Forms that pass validation are "test@xyz.com" or "test@xyz.com (Test McTester)" ). And who would want to advertise their real email like that? :) 2) Removed the tag from the . isn't a valid child element of a channel. There is a child element called that is a close analogue but it also requires content as above. --- src/cryogen_core/rss.clj | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/cryogen_core/rss.clj b/src/cryogen_core/rss.clj index eca46fe..8aa6e44 100644 --- a/src/cryogen_core/rss.clj +++ b/src/cryogen_core/rss.clj @@ -5,7 +5,7 @@ (:import java.util.Date)) -(defn posts-to-items [site-url author posts] +(defn posts-to-items [site-url posts] (map (fn [{:keys [uri title content date]}] (let [link (str (if (.endsWith site-url "/") (apply str (butlast site-url)) site-url) uri)] @@ -13,8 +13,7 @@ :link link :title title :description content - :pubDate date - :author author})) + :pubDate date})) posts)) (defn make-channel [config posts] @@ -24,12 +23,11 @@ {:title (:site-title config) :link (:site-url config) :description (:description config) - :lastBuildDate (Date.) - :author (:author config)}) - (posts-to-items (:site-url config) (:author config) posts))) + :lastBuildDate (Date.)}) + (posts-to-items (:site-url config) posts))) (defn make-filtered-channels [public {:keys [rss-filters blog-prefix] :as config} posts-by-tag] (doseq [filter rss-filters] (let [uri (str public blog-prefix "/" (name filter) ".xml")] (println "\t-->" (cyan uri)) - (spit uri (make-channel config (get posts-by-tag filter)))))) \ No newline at end of file + (spit uri (make-channel config (get posts-by-tag filter))))))