hakyll-4.16.2.0: A static website compiler library

Safe Haskell | Safe-Inferred
Language | Haskell2010

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`

Synopsis

- data FeedConfiguration = FeedConfiguration {
  - feedTitle :: String
  - feedDescription :: String
  - feedAuthorName :: String
  - feedAuthorEmail :: String
  - feedRoot :: String
  }
- renderRss :: FeedConfiguration -> Context String -> [Item String] -> Compiler (Item String)
- renderAtom :: FeedConfiguration -> Context String -> [Item String] -> Compiler (Item String)
- renderJson :: FeedConfiguration -> Context String -> [Item String] -> Compiler (Item String)
- renderRssWithTemplates :: Template -> Template -> FeedConfiguration -> Context String -> [Item String] -> Compiler (Item String)
- renderAtomWithTemplates :: Template -> Template -> FeedConfiguration -> Context String -> [Item String] -> Compiler (Item String)
- renderJsonWithTemplates :: Template -> Template -> FeedConfiguration -> Context String -> [Item String] -> Compiler (Item String)

# Documentation

data FeedConfiguration Source #

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

Constructors

FeedConfiguration |

Fields

- feedTitle :: String

  Title of the feed.

- feedDescription :: String

  Description of the feed.

- feedAuthorName :: String

  Name of the feed author.

- feedAuthorEmail :: String

  Email of the feed author. Set this to the empty String to leave out the email address.

- feedRoot :: String

  Absolute root URL of the feed site (e.g. `http://jaspervdj.be`)

#### Instances

Instances details

Show FeedConfiguration Source # |
Instance details Defined in Hakyll.Web.Feed Methods showsPrec :: Int -> FeedConfiguration -> ShowS Source # show :: FeedConfiguration -> String Source # showList :: [FeedConfiguration] -> ShowS Source #
Eq FeedConfiguration Source # |
Instance details Defined in Hakyll.Web.Feed Methods (==) :: FeedConfiguration -> FeedConfiguration -> Bool Source # (/=) :: FeedConfiguration -> FeedConfiguration -> Bool Source #

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.

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.

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.

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.

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.