hakyll-4.16.7.1: A static website compiler library
Safe HaskellNone
LanguageHaskell2010

Hakyll.Web.Feed

Description

A Module that allows easy rendering of RSS feeds.

The main rendering functions (renderRss, renderAtom) all assume that you pass the list of items so that the most recent entry in the feed is the first item in the list.

Also note that the context should have (at least) the following fields to produce a correct feed:

  • $title$: Title of the item
  • $description$: Description to appear in the feed
  • $url$: URL to the item - this is usually set automatically.

In addition, the posts should be named according to the rules for dateField

Note that for XML-based feeds (i.e. Atom and RSS) field values are not escaped! However, the default renderRss and renderAtom functions will validate the produced XML. Use the -NoValidate functions instead if you need to skip this validation.

Synopsis

Documentation

data FeedConfiguration Source #

This is a data structure to keep the configuration of a feed.

Constructors

FeedConfiguration 

Fields

renderRss Source #

Arguments

:: FeedConfiguration

Feed configuration

-> Context String

Item context

-> [Item String]

Feed items

-> Compiler (Item String)

Resulting feed

Render an RSS feed with a number of items.

The resulting RSS feed will be validated automatically.

renderRssNoValidate Source #

Arguments

:: FeedConfiguration

Feed configuration

-> Context String

Item context

-> [Item String]

Feed items

-> Compiler (Item String)

Resulting feed

Render an RSS feed with a number of items.

The resulting feed will not be validated. Prefer to use renderRss when possible.

Since: 4.16.7.0

renderAtom Source #

Arguments

:: FeedConfiguration

Feed configuration

-> Context String

Item context

-> [Item String]

Feed items

-> Compiler (Item String)

Resulting feed

Render an Atom feed with a number of items.

The resulting Atom feed will be validated automatically.

renderAtomNoValidate Source #

Arguments

:: FeedConfiguration

Feed configuration

-> Context String

Item context

-> [Item String]

Feed items

-> Compiler (Item String)

Resulting feed

Render an Atom feed with a number of items.

The resulting feed will not be validated. Prefer to use renderAtom when possible.

Since: 4.16.7.0

renderJson Source #

Arguments

:: FeedConfiguration

Feed configuration

-> Context String

Item context

-> [Item String]

Feed items

-> Compiler (Item String)

Resulting feed

Render a JSON feed with a number of items.

Items' bodies will be put into content_html field of the resulting JSON; the content field will not be set.

renderRssWithTemplates Source #

Arguments

:: Template

Feed template

-> Template

Item template

-> FeedConfiguration

Feed configuration

-> Context String

Item context

-> [Item String]

Feed items

-> Compiler (Item String)

Resulting feed

Render an RSS feed using given templates with a number of items.

The resulting RSS feed will be validated automatically.

renderRssWithTemplatesNoValidate Source #

Arguments

:: Template

Feed template

-> Template

Item template

-> FeedConfiguration

Feed configuration

-> Context String

Item context

-> [Item String]

Feed items

-> Compiler (Item String)

Resulting feed

Render an RSS feed using given templates with a number of items.

The resulting feed will not be validated. Prefer to use renderRssWithTemplates when possible.

Since: 4.16.7.0

renderAtomWithTemplates Source #

Arguments

:: Template

Feed template

-> Template

Item template

-> FeedConfiguration

Feed configuration

-> Context String

Item context

-> [Item String]

Feed items

-> Compiler (Item String)

Resulting feed

Render an Atom feed using given templates with a number of items.

The resulting Atom feed will be validated automatically.

renderAtomWithTemplatesNoValidate Source #

Arguments

:: Template

Feed template

-> Template

Item template

-> FeedConfiguration

Feed configuration

-> Context String

Item context

-> [Item String]

Feed items

-> Compiler (Item String)

Resulting feed

Render an Atom feed using given templates with a number of items.

The resulting feed will not be validated. Prefer to use renderAtomWithTemplates when possible.

Since: 4.16.7.0

renderJsonWithTemplates Source #

Arguments

:: Template

Feed template

-> Template

Item template

-> FeedConfiguration

Feed configuration

-> Context String

Item context

-> [Item String]

Feed items

-> Compiler (Item String)

Resulting feed

Render a JSON feed using given templates with a number of items.

validateXMLFeed :: Item String -> Compiler (Item String) Source #

Validate that a feed contains only correct XML.