Build a feed following the RSS 2.0 format https://validator.w3.org/feed/docs/rss2.html. http://www.rssboard.org/rss-specification
generate : { title : String, description : String, url : String, lastBuildTime : Time.Posix, generator : Maybe String, items : List Item, siteUrl : String } -> String
Generate an RSS feed from feed metadata and a list of Rss.Item
s.
{ title : String
, description : String
, url : String
, categories : List String
, author : String
, pubDate : DateOrTime
, content : Maybe String
, contentEncoded : Maybe String
, enclosure : Maybe { url : String
, mimeType : String
, bytes : Maybe Basics.Int }
}
Data representing an RSS feed item.
contentEncoded - Use this to
add HTML content
in a <content:encoded>
tag in the RSS feed. Some feed readers
will use this field if present to render HTML. Note that Elm doesn't
provide a way to turn Html.Html
values into a String
.
You can use zwilias/elm-html-string
to
render HTML using a drop-in replacement API and then turn that into a String.
Here's an example that shows how to render to an HTML String
using dillonkearns/elm-markdown
.
https://demo.ghost.io/author/lewis/rss/
Encoding
enclosure - link to an attached file
https://www.rssboard.org/rss-enclosures-use-case
Can be one of:
Rss.Date
- a Date
value from justinmimbs/date
, orRss.DateTime
- a Time.Posix
from elm/time
.If you pass in an Rss.Date
, it will format it at 00:00:00 GMT
on the given date (start of day).
If you pass in an Rss.DateTime
, it will format the time in UTC.
{ url : String
, mimeType : String
, bytes : Maybe Basics.Int
}
Represents a linked file.
https://validator.w3.org/feed/docs/rss2.html#ltenclosuregtSubelementOfLtitemgt