on master help sign in
Made hakyll website up-to-date with master branch.
commit8da35f6c6df6f947506fa4fa2f3705c88b9f56ab authorJasper Van der Jeugt <jaspervdj@gmail.com> dateMon 18 Jan 2010, 22:17 (17 years ago) parent417ccac
4 files changed+23−31
examples/hakyll/hakyll.hs+4−5 examples/hakyll/tutorial1.markdown+6−8 examples/hakyll/tutorial2.markdown+7−10 examples/hakyll/tutorial4.markdown+6−8
examples/hakyll/hakyll.hs+4−5
@@ -2,20 +2,19 @@ import Text.Hakyll
22import Text.Hakyll.Render
33import Text.Hakyll.Renderables
44import Text.Hakyll.File
5+import Text.Hakyll.Regex
56
67import Control.Monad (mapM_, liftM)
78import Data.List (sort)
89
9−import Text.Regex.Posix
10−
11−main = hakyll $ do
10+main = hakyll defaultHakyllConfiguration $ do
1211 directory css "css"
1312 directory static "images"
1413 directory static "examples"
1514 directory static "reference"
1615
17− tutorials <- liftM (sort . filter (=~ "tutorial[0-9]*.markdown")) $ getRecursiveContents "."
18− let tutorialList = renderAndConcat "templates/tutorialitem.html"
16+ tutorials <- liftM (sort . filter (`matchesRegex` "tutorial[0-9]*.markdown")) $ getRecursiveContents "."
17+ let tutorialList = renderAndConcat ["templates/tutorialitem.html"]
1918 (map createPagePath tutorials)
2019 tutorialPage = createCustomPage "tutorials.html"
2120 ("templates/tutorialitem.html" : tutorials)
examples/hakyll/tutorial1.markdown+6−8
@@ -66,14 +66,12 @@ metadata. The metadata is placed in the file header and surrouded by `---`
6666lines. Each line should contain a `key: value` pair. Let's have a look at the
6767`about.markdown` page.
6868
69−~~~~~{.markdown}
70−---
71−title: About
72−---
73−Nullam imperdiet sodales orci vitae molestie.
74−Nunc quam orci, pharetra a rhoncus vitae,
75−eleifend id felis. Suspendisse potenti...
76−~~~~~
69+> ---
70+> title: About
71+> ---
72+> Nullam imperdiet sodales orci vitae molestie.
73+> Nunc quam orci, pharetra a rhoncus vitae,
74+> eleifend id felis. Suspendisse potenti...
7775
7876This contains one `key: value` pair, namely `title: About`. The rest of the
7977file is treated as markdown by pandoc. If you want to know more about
examples/hakyll/tutorial2.markdown+7−10
@@ -29,16 +29,13 @@ provide us with all the blog posts. The blog posts have a
2929can sort them easily, you could of course name them whatever you want. They
3030contain some metadata, too:
3131
32−~~~~~{.markdown}
33−---
34−title: A first post
35−author: Julius Caesar
36−date: November 5, 2009
37−---
38−Lorem ipsum dolor sit amet, consectetur adipiscing elit.
39−Vivamus pretium leo adipiscing lectus iaculis lobortis.
40−Vivamus scelerisque velit dignissim metus...
41−~~~~~
32+> title: A first post
33+> author: Julius Caesar
34+> date: November 5, 2009
35+> ---
36+> Lorem ipsum dolor sit amet, consectetur adipiscing elit.
37+> Vivamus pretium leo adipiscing lectus iaculis lobortis.
38+> Vivamus scelerisque velit dignissim metus...
4239
4340Now, we find the posts and sort them reversed:
4441
examples/hakyll/tutorial4.markdown+6−8
@@ -95,14 +95,12 @@ Hakyll has a specialized module to deal with tags, provided by
9595`Text.Hakyll.Tags`. This module assumes tags are comma separated, and placed in
9696the `tags` metadata field.
9797
98−~~~~~
99−---
100−title: A third post
101−author: Publius Ovidius Naso
102−tags: epic fail, ovidius
103−---
104−Pellentesque tempor blandit elit, vel...
105−~~~~~
98+> ---
99+> title: A third post
100+> author: Publius Ovidius Naso
101+> tags: epic fail, ovidius
102+> ---
103+> Pellentesque tempor blandit elit, vel...
106104
107105But first things first. We need to render a post list for every tag. We already
108106had some code to render a list of all posts. We're just going to abstract this