diff options
Diffstat (limited to 'examples')
-rw-r--r-- | examples/categoryblog/css/default.css | 17 | ||||
-rw-r--r-- | examples/categoryblog/hakyll.hs | 80 | ||||
-rw-r--r-- | examples/categoryblog/index.html | 18 | ||||
-rw-r--r-- | examples/categoryblog/posts.html | 4 | ||||
-rw-r--r-- | examples/categoryblog/posts/coding/2009-11-05-a-first-post.markdown | 20 | ||||
-rw-r--r-- | examples/categoryblog/posts/coding/2009-11-28-a-third-post.markdown | 18 | ||||
-rw-r--r-- | examples/categoryblog/posts/coding/2009-12-04-this-blog-aint-dead.markdown | 11 | ||||
-rw-r--r-- | examples/categoryblog/posts/random/2009-11-10-another-post.markdown | 14 | ||||
-rw-r--r-- | examples/categoryblog/posts/random/2009-12-23-almost-christmas.markdown | 12 | ||||
-rw-r--r-- | examples/categoryblog/templates/default.html | 23 | ||||
-rw-r--r-- | examples/categoryblog/templates/post.html | 5 | ||||
-rw-r--r-- | examples/categoryblog/templates/postitem.html | 4 |
12 files changed, 0 insertions, 226 deletions
diff --git a/examples/categoryblog/css/default.css b/examples/categoryblog/css/default.css deleted file mode 100644 index 9ed2b01..0000000 --- a/examples/categoryblog/css/default.css +++ /dev/null @@ -1,17 +0,0 @@ -body { - width: 600px; - margin: 0px auto 0px auto; -} - -div#navigation { - text-align: center; - border-bottom: 4px solid black; -} - -div#navigation a { - color: white; - text-decoration: none; - background-color: black; - padding: 3px 10px 3px 10px; - margin: 0px 10px 0px 10px; -} diff --git a/examples/categoryblog/hakyll.hs b/examples/categoryblog/hakyll.hs deleted file mode 100644 index dd3051d..0000000 --- a/examples/categoryblog/hakyll.hs +++ /dev/null @@ -1,80 +0,0 @@ -module Main where - -import Control.Arrow ((>>>), arr) -import Text.Hakyll (hakyll) -import Text.Hakyll.Render -import Text.Hakyll.Tags (readCategoryMap, withTagMap) -import Text.Hakyll.Feed (FeedConfiguration (..), renderRss) -import Text.Hakyll.File (getRecursiveContents, directory, removeSpaces, sortByBaseName) -import Text.Hakyll.CreateContext (createPage, createCustomPage, createListing) -import Text.Hakyll.ContextManipulations (renderDate, copyValue, changeValue) -import Text.Hakyll.Util (link) -import Data.Map (toList) -import Control.Monad (forM_, liftM, (<=<)) -import Data.Either (Either(..)) - -main = hakyll "http://example.com" $ do - -- Static directory. - directory css "css" - - -- Find all post paths. - postPaths <- liftM (reverse . sortByBaseName) $ getRecursiveContents "posts" - let renderablePosts = map ((>>> postManipulation) . createPage) postPaths - - -- Read category map. - let categoryMap = readCategoryMap "categoryMap" postPaths - - -- Render all posts list. - renderPostList "posts.html" "All posts" renderablePosts - - -- Render post list per category - let renderListForCategory category posts = - renderPostList (categoryToUrl category) ("Posts about " ++ category) - (map (>>> postManipulation) posts) - withTagMap categoryMap renderListForCategory - - -- Render index, including recent posts. - let categoryList' = categoryMap >>> categoryList - let index = createListing "index.html" - ["templates/postitem.html"] - (take 3 renderablePosts) - [ ("title", Left "Home") - , ("categories", Right $ categoryList') - ] - renderChain ["index.html", "templates/default.html"] index - - -- Render all posts. - forM_ renderablePosts $ renderChain [ "templates/post.html" - , "templates/default.html" - ] - - -- Render rss feed - renderRss myFeedConfiguration $ - map (>>> copyValue "body" "description") (take 3 renderablePosts) - - where - postManipulation = renderDate "date" "%B %e, %Y" "Date unknown" - >>> renderCategoryLink - - renderCategoryLink = - changeValue "category" (\c -> link c $ categoryToUrl c) - - categoryToUrl c = "$root/categories/" ++ removeSpaces c ++ ".html" - - categoryList = arr $ uncurry categoryListItem <=< toList - - categoryListItem category posts = - "<li>" ++ link category (categoryToUrl category) - ++ " - " ++ show (length posts) ++ " items.</li>" - - renderPostList url title posts = do - let list = createListing url ["templates/postitem.html"] - posts [("title", Left title)] - renderChain ["posts.html", "templates/default.html"] list - -myFeedConfiguration = FeedConfiguration - { feedUrl = "rss.xml" - , feedTitle = "SimpleBlog RSS feed." - , feedDescription = "A simple demo of an RSS feed created with Hakyll." - , feedAuthorName = "Jasper Van der Jeugt" - } diff --git a/examples/categoryblog/index.html b/examples/categoryblog/index.html deleted file mode 100644 index 4d5ca8a..0000000 --- a/examples/categoryblog/index.html +++ /dev/null @@ -1,18 +0,0 @@ -<div id="posts"> - <h1>Recent posts</h1> - <ul> - $body - </ul> - <a href="$root/posts.html">All posts...</a> - <h1>Categories</h1> - <ul> - $categories - </ul> -</div> - -<div class="about"> - <h1>About</h1> - <p> - This is a sample blog for educational purposes. - </p> -</div> diff --git a/examples/categoryblog/posts.html b/examples/categoryblog/posts.html deleted file mode 100644 index ee2ed78..0000000 --- a/examples/categoryblog/posts.html +++ /dev/null @@ -1,4 +0,0 @@ -<h1>$title</h1> -<ul> - $body -</ul> diff --git a/examples/categoryblog/posts/coding/2009-11-05-a-first-post.markdown b/examples/categoryblog/posts/coding/2009-11-05-a-first-post.markdown deleted file mode 100644 index aa7de69..0000000 --- a/examples/categoryblog/posts/coding/2009-11-05-a-first-post.markdown +++ /dev/null @@ -1,20 +0,0 @@ ---- -title: A first post -author: Julius Caesar ---- -Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus pretium leo -adipiscing lectus iaculis lobortis. Vivamus scelerisque velit dignissim metus -gravida sit amet dapibus ligula tempor. Quisque sit amet viverra nunc. -Suspendisse cursus elementum ante, ut venenatis nisi dictum eu. Nulla diam -ligula, eleifend in varius quis, malesuada a nibh. Vivamus consequat -pellentesque erat non blandit. Nunc sit amet eros vel massa semper ullamcorper -quis iaculis magna. Vestibulum ullamcorper urna sit amet est elementum -pulvinar. Vestibulum consequat lacus ac quam hendrerit tincidunt. Praesent -bibendum vehicula diam, nec sagittis risus tempus a. Nulla quis odio sit amet -odio vehicula cursus ut id odio. Curabitur semper magna euismod magna mollis -venenatis. Nunc eget eleifend velit. Mauris sed posuere sem. Fusce id nunc -nisi, a aliquam orci. Suspendisse laoreet justo non enim laoreet eget consequat -velit porttitor. Aenean faucibus sodales metus at tincidunt. Donec vestibulum -leo pulvinar erat auctor ac ultrices massa euismod. Phasellus blandit cursus -magna, eget lacinia mi lobortis sed. Suspendisse ultricies enim ligula, vel -scelerisque mauris. diff --git a/examples/categoryblog/posts/coding/2009-11-28-a-third-post.markdown b/examples/categoryblog/posts/coding/2009-11-28-a-third-post.markdown deleted file mode 100644 index 71b911e..0000000 --- a/examples/categoryblog/posts/coding/2009-11-28-a-third-post.markdown +++ /dev/null @@ -1,18 +0,0 @@ ---- -title: A third post -author: Publius Ovidius Naso ---- -Pellentesque tempor blandit elit, vel ultricies arcu congue egestas. Fusce -vitae rutrum nisl. Fusce id mauris libero, a venenatis tellus. Fusce iaculis, -lorem et ornare molestie, mauris risus mollis nisi, non fermentum lacus lacus -sit amet ipsum. Praesent lobortis ullamcorper dolor, eget convallis ligula -dignissim a. Suspendisse nulla nisi, congue et pharetra vel, convallis non -libero. Ut a nulla ipsum. Phasellus cursus velit id neque viverra ut -pellentesque justo posuere. Curabitur laoreet enim et velit tempor consectetur. -Donec eu pretium urna. Suspendisse vitae nisi at metus vestibulum aliquam in -sit amet nisl. Donec convallis lacinia odio, vestibulum molestie nunc feugiat -a. Suspendisse vehicula, sapien id aliquet consectetur, sem sapien ullamcorper -arcu, scelerisque porttitor elit ipsum posuere ligula. Nulla at velit eu metus -tincidunt auctor ut sit amet enim. Donec placerat dapibus nisi id facilisis. -Maecenas pellentesque pulvinar auctor. Curabitur gravida quam sit amet purus -consectetur blandit. diff --git a/examples/categoryblog/posts/coding/2009-12-04-this-blog-aint-dead.markdown b/examples/categoryblog/posts/coding/2009-12-04-this-blog-aint-dead.markdown deleted file mode 100644 index 3b5edb6..0000000 --- a/examples/categoryblog/posts/coding/2009-12-04-this-blog-aint-dead.markdown +++ /dev/null @@ -1,11 +0,0 @@ ---- -title: This blog ain't dead -author: Marcus Antonius ---- -Etiam non felis aliquet tellus dictum vestibulum. Aliquam accumsan mauris non -lacus ultricies nec lacinia enim rhoncus. Curabitur vel tortor massa, elementum -tincidunt elit. Maecenas venenatis luctus arcu ut ullamcorper. Donec interdum -dolor eu enim tristique vel vehicula risus mollis. Nunc nec tortor quam. Nulla -a mauris arcu. Phasellus venenatis tortor vel odio tincidunt consequat. Integer -venenatis nibh vitae lectus laoreet eu feugiat nunc pretium. Integer nec turpis -metus, in fermentum lorem. diff --git a/examples/categoryblog/posts/random/2009-11-10-another-post.markdown b/examples/categoryblog/posts/random/2009-11-10-another-post.markdown deleted file mode 100644 index 0e00876..0000000 --- a/examples/categoryblog/posts/random/2009-11-10-another-post.markdown +++ /dev/null @@ -1,14 +0,0 @@ ---- -title: Another post -author: Marcus Tullius Cicero ---- -Vestibulum in ultrices urna. Etiam tempor enim dui, nec malesuada elit. Donec -tempor ligula et quam volutpat quis fermentum eros congue. Sed ut pulvinar sem. -Sed aliquam ipsum id purus sollicitudin vulputate. Cras et mauris dui, vel -hendrerit leo. Ut metus ipsum, fermentum ac malesuada id, tempus pharetra quam. -Donec diam felis, consequat ac scelerisque cursus, gravida non lectus. Sed -faucibus elit dapibus diam elementum id varius nisi tristique. Proin consequat -faucibus neque in aliquam. Vestibulum ligula odio, pulvinar vel hendrerit -vitae, egestas ut nibh. Praesent ut velit elit, in consequat dolor. Praesent -sem enim, commodo in gravida sed, adipiscing vel eros. Lorem ipsum dolor sit -amet, consectetur adipiscing elit. Proin non aliquam nunc. diff --git a/examples/categoryblog/posts/random/2009-12-23-almost-christmas.markdown b/examples/categoryblog/posts/random/2009-12-23-almost-christmas.markdown deleted file mode 100644 index 6f2e179..0000000 --- a/examples/categoryblog/posts/random/2009-12-23-almost-christmas.markdown +++ /dev/null @@ -1,12 +0,0 @@ ---- -title: Almost Christmas! -author: Publius Vergilius Maro ---- -Morbi tincidunt eleifend ante, eu gravida ante rutrum vel. Nunc bibendum nulla -tellus, eget egestas sapien. Nam rhoncus interdum libero, eget congue orci -imperdiet eu. Quisque pellentesque fringilla urna, ac venenatis ante ultricies -et. Pellentesque habitant morbi tristique senectus et netus et malesuada fames -ac turpis egestas. Mauris eleifend sagittis ultrices. Quisque ultrices accumsan -nisl, sed pellentesque metus porta vitae. Nulla facilisi. In et nibh tincidunt -mi volutpat pellentesque vitae nec sapien. Integer massa ipsum, pellentesque in -elementum at, cursus sit amet diam. diff --git a/examples/categoryblog/templates/default.html b/examples/categoryblog/templates/default.html deleted file mode 100644 index 049a37a..0000000 --- a/examples/categoryblog/templates/default.html +++ /dev/null @@ -1,23 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" -"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> - <title>SimpleBlog - $title</title> - <link rel="stylesheet" type="text/css" href="$root/css/default.css" /> - <link rel="alternate" - type="application/rss+xml" - title="SimpleBlog" - href="http://example.com/rss.xml" /> - </head> - <body> - <h1>SimpleBlog - $title</h1> - <div id="navigation"> - <a href="$root/index.html">Home</a> - <a href="$root/posts.html">All posts</a> - </div> - - $body - </body> -</html> diff --git a/examples/categoryblog/templates/post.html b/examples/categoryblog/templates/post.html deleted file mode 100644 index 224a77d..0000000 --- a/examples/categoryblog/templates/post.html +++ /dev/null @@ -1,5 +0,0 @@ -<h1>$title</h1> -by <em>$author</em> on <strong>$date</strong> -<div>Posted in: $category.</div> - -$body diff --git a/examples/categoryblog/templates/postitem.html b/examples/categoryblog/templates/postitem.html deleted file mode 100644 index 0e62418..0000000 --- a/examples/categoryblog/templates/postitem.html +++ /dev/null @@ -1,4 +0,0 @@ -<li> - <a href="$root/$url">$title</a> - - <em>$date</em> - by <em>$author</em> -</li> |