Merge pull request #37 from ClashTheBunny/podcasts
Add enclosure tag to facilitate Podcasting with Cryogen
This commit is contained in:
commit
85ede46a9e
2 changed files with 5 additions and 4 deletions
|
@ -143,7 +143,7 @@
|
|||
"Adds the uri and title of a post to the list of posts under each of its tags"
|
||||
[tags post]
|
||||
(reduce (fn [tags tag]
|
||||
(update-in tags [tag] (fnil conj []) (select-keys post [:uri :title :content :date])))
|
||||
(update-in tags [tag] (fnil conj []) (select-keys post [:uri :title :content :date :enclosure])))
|
||||
tags (:tags post)))
|
||||
|
||||
(defn group-by-tags
|
||||
|
|
|
@ -1,18 +1,19 @@
|
|||
(ns cryogen-core.rss
|
||||
(:require [clj-rss.core :as rss]
|
||||
[clojure.xml :refer [emit]]
|
||||
[text-decoration.core :refer :all])
|
||||
(:import java.util.Date))
|
||||
|
||||
|
||||
(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)]
|
||||
(fn [{:keys [uri title content date enclosure]}]
|
||||
(let [link (str (if (.endsWith site-url "/") (apply str (butlast site-url)) site-url) uri)
|
||||
enclosure (if (nil? enclosure) "" enclosure)]
|
||||
{:guid link
|
||||
:link link
|
||||
:title title
|
||||
:description content
|
||||
:enclosure enclosure
|
||||
:pubDate date}))
|
||||
posts))
|
||||
|
||||
|
|
Loading…
Reference in a new issue