From 3ae0c088f22fef27bf73cbc6508e91431f970118 Mon Sep 17 00:00:00 2001 From: Jasper Van der Jeugt Date: Sat, 12 Jan 2013 16:34:48 +0100 Subject: Start feed tutorial… MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/tutorials/05-snapshots-feeds.markdown | 39 +++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 web/tutorials/05-snapshots-feeds.markdown (limited to 'web/tutorials') diff --git a/web/tutorials/05-snapshots-feeds.markdown b/web/tutorials/05-snapshots-feeds.markdown new file mode 100644 index 0000000..d113aa2 --- /dev/null +++ b/web/tutorials/05-snapshots-feeds.markdown @@ -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) +``` -- cgit v1.2.3