Start feed tutorial…
This commit is contained in:
parent
5738a987d3
commit
3ae0c088f2
1 changed files with 39 additions and 0 deletions
39
web/tutorials/05-snapshots-feeds.markdown
Normal file
39
web/tutorials/05-snapshots-feeds.markdown
Normal file
|
@ -0,0 +1,39 @@
|
||||||
|
---
|
||||||
|
title: Snapshots, and how to produce an RSS/Atom feed
|
||||||
|
author: Jasper Van der Jeugt
|
||||||
|
---
|
||||||
|
|
||||||
|
Basic feed configuration
|
||||||
|
------------------------
|
||||||
|
|
||||||
|
Hakyll has built-in support for two types of feeds: RSS and Atom. This tutorial
|
||||||
|
explains how you can add these to your blog or website. The first step is to
|
||||||
|
define a `FeedConfiguration` to set some basic options. For example, a cooking
|
||||||
|
blog may have the following declaration:
|
||||||
|
|
||||||
|
```haskell
|
||||||
|
myFeedConfiguration :: FeedConfiguration
|
||||||
|
myFeedConfiguration = FeedConfiguration
|
||||||
|
{ feedTitle = "Healthy cooking: latest recipes"
|
||||||
|
, feedDescription = "This feed provides fresh recipes for fresh food!"
|
||||||
|
, feedAuthorName = "John Doe"
|
||||||
|
, feedAuthorEmail = "test@example.com"
|
||||||
|
, feedRoot = "http://healthycooking.example.com"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
Now, we'll create the actual feed.
|
||||||
|
|
||||||
|
```haskell
|
||||||
|
renderAtom :: FeedConfiguration
|
||||||
|
-> Context String
|
||||||
|
-> [Item String]
|
||||||
|
-> Compiler (Item String)
|
||||||
|
```
|
||||||
|
|
||||||
|
```haskell
|
||||||
|
renderRss :: FeedConfiguration
|
||||||
|
-> Context String
|
||||||
|
-> [Item String]
|
||||||
|
-> Compiler (Item String)
|
||||||
|
```
|
Loading…
Reference in a new issue