summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorJasper Van der Jeugt <jaspervdj@gmail.com>2010-01-18 22:17:03 +0100
committerJasper Van der Jeugt <jaspervdj@gmail.com>2010-01-18 22:17:03 +0100
commit8da35f6c6df6f947506fa4fa2f3705c88b9f56ab (patch)
tree3fe5e010a2131b07a5d98e6dffd43ac187bda5d0 /examples
parent417ccaccfcab8ac87b312abdcbdc91d644a6dea7 (diff)
downloadhakyll-8da35f6c6df6f947506fa4fa2f3705c88b9f56ab.tar.gz
Made hakyll website up-to-date with master branch.
Diffstat (limited to 'examples')
-rw-r--r--examples/hakyll/hakyll.hs9
-rw-r--r--examples/hakyll/tutorial1.markdown14
-rw-r--r--examples/hakyll/tutorial2.markdown17
-rw-r--r--examples/hakyll/tutorial4.markdown14
4 files changed, 23 insertions, 31 deletions
diff --git a/examples/hakyll/hakyll.hs b/examples/hakyll/hakyll.hs
index 960b82a..de97c56 100644
--- a/examples/hakyll/hakyll.hs
+++ b/examples/hakyll/hakyll.hs
@@ -2,20 +2,19 @@ import Text.Hakyll
import Text.Hakyll.Render
import Text.Hakyll.Renderables
import Text.Hakyll.File
+import Text.Hakyll.Regex
import Control.Monad (mapM_, liftM)
import Data.List (sort)
-import Text.Regex.Posix
-
-main = hakyll $ do
+main = hakyll defaultHakyllConfiguration $ do
directory css "css"
directory static "images"
directory static "examples"
directory static "reference"
- tutorials <- liftM (sort . filter (=~ "tutorial[0-9]*.markdown")) $ getRecursiveContents "."
- let tutorialList = renderAndConcat "templates/tutorialitem.html"
+ tutorials <- liftM (sort . filter (`matchesRegex` "tutorial[0-9]*.markdown")) $ getRecursiveContents "."
+ let tutorialList = renderAndConcat ["templates/tutorialitem.html"]
(map createPagePath tutorials)
tutorialPage = createCustomPage "tutorials.html"
("templates/tutorialitem.html" : tutorials)
diff --git a/examples/hakyll/tutorial1.markdown b/examples/hakyll/tutorial1.markdown
index 69c8f6b..fafaea7 100644
--- a/examples/hakyll/tutorial1.markdown
+++ b/examples/hakyll/tutorial1.markdown
@@ -66,14 +66,12 @@ metadata. The metadata is placed in the file header and surrouded by `---`
lines. Each line should contain a `key: value` pair. Let's have a look at the
`about.markdown` page.
-~~~~~{.markdown}
----
-title: About
----
-Nullam imperdiet sodales orci vitae molestie.
-Nunc quam orci, pharetra a rhoncus vitae,
-eleifend id felis. Suspendisse potenti...
-~~~~~
+> ---
+> title: About
+> ---
+> Nullam imperdiet sodales orci vitae molestie.
+> Nunc quam orci, pharetra a rhoncus vitae,
+> eleifend id felis. Suspendisse potenti...
This contains one `key: value` pair, namely `title: About`. The rest of the
file is treated as markdown by pandoc. If you want to know more about
diff --git a/examples/hakyll/tutorial2.markdown b/examples/hakyll/tutorial2.markdown
index 5cfbb9c..0fa4002 100644
--- a/examples/hakyll/tutorial2.markdown
+++ b/examples/hakyll/tutorial2.markdown
@@ -29,16 +29,13 @@ provide us with all the blog posts. The blog posts have a
can sort them easily, you could of course name them whatever you want. They
contain some metadata, too:
-~~~~~{.markdown}
----
-title: A first post
-author: Julius Caesar
-date: November 5, 2009
----
-Lorem ipsum dolor sit amet, consectetur adipiscing elit.
-Vivamus pretium leo adipiscing lectus iaculis lobortis.
-Vivamus scelerisque velit dignissim metus...
-~~~~~
+> title: A first post
+> author: Julius Caesar
+> date: November 5, 2009
+> ---
+> Lorem ipsum dolor sit amet, consectetur adipiscing elit.
+> Vivamus pretium leo adipiscing lectus iaculis lobortis.
+> Vivamus scelerisque velit dignissim metus...
Now, we find the posts and sort them reversed:
diff --git a/examples/hakyll/tutorial4.markdown b/examples/hakyll/tutorial4.markdown
index 82e246a..d1d6366 100644
--- a/examples/hakyll/tutorial4.markdown
+++ b/examples/hakyll/tutorial4.markdown
@@ -95,14 +95,12 @@ Hakyll has a specialized module to deal with tags, provided by
`Text.Hakyll.Tags`. This module assumes tags are comma separated, and placed in
the `tags` metadata field.
-~~~~~
----
-title: A third post
-author: Publius Ovidius Naso
-tags: epic fail, ovidius
----
-Pellentesque tempor blandit elit, vel...
-~~~~~
+> ---
+> title: A third post
+> author: Publius Ovidius Naso
+> tags: epic fail, ovidius
+> ---
+> Pellentesque tempor blandit elit, vel...
But first things first. We need to render a post list for every tag. We already
had some code to render a list of all posts. We're just going to abstract this