summaryrefslogtreecommitdiff
path: root/data/example
diff options
context:
space:
mode:
authorJasper Van der Jeugt <m@jaspervdj.be>2012-12-13 11:08:41 +0100
committerJasper Van der Jeugt <m@jaspervdj.be>2012-12-13 11:08:41 +0100
commit00262e3f6dd84ac9f44d7b1f23111336ef937c5e (patch)
tree015940b1e3826e3f67d8a069dba3cc1ac72e7808 /data/example
parent251e1126c38eafca2890c3bfd268956624cf3397 (diff)
downloadhakyll-00262e3f6dd84ac9f44d7b1f23111336ef937c5e.tar.gz
Update example site
Diffstat (limited to 'data/example')
-rw-r--r--data/example/code.lhs21
-rw-r--r--data/example/contact.markdown6
-rw-r--r--data/example/css/default.css14
-rw-r--r--data/example/css/syntax.css18
-rw-r--r--data/example/index.html19
-rw-r--r--data/example/index.markdown27
-rw-r--r--data/example/posts/2012-08-12-spqr.markdown59
-rw-r--r--data/example/posts/2012-10-07-rosa-rosa-rosam.markdown45
-rw-r--r--data/example/posts/2012-11-28-carpe-diem.markdown50
-rw-r--r--data/example/posts/2012-11-28-example-post.markdown5
-rw-r--r--data/example/posts/2012-12-07-running-hakyll.markdown7
-rw-r--r--data/example/posts/2012-12-07-tu-quoque.markdown57
-rw-r--r--data/example/site.hs50
-rw-r--r--data/example/templates/archive.html3
-rw-r--r--data/example/templates/default.html8
-rw-r--r--data/example/templates/post-item.html3
-rw-r--r--data/example/templates/post.html3
17 files changed, 300 insertions, 95 deletions
diff --git a/data/example/code.lhs b/data/example/code.lhs
deleted file mode 100644
index e98ec85..0000000
--- a/data/example/code.lhs
+++ /dev/null
@@ -1,21 +0,0 @@
----
-title: Code
----
-Etiam condimentum auctor semper. Donec lobortis, magna id sodales sollicitudin,
-lectus mi egestas nulla, pulvinar lobortis nunc eros id nisl. Curabitur
-imperdiet, erat at accumsan vulputate.
-
-> reverse' [] = []
-> reverse' (x:xs) = (reverse' xs) ++ [x]
-
-Purus nunc blandit nulla, dictum.
-
-vestibulum sem lorem eget ipsum. Nunc tincidunt, turpis ut fermentum dapibus,
-justo tortor bibendum sem, at facilisis justo odio luctus lectus. Quisque nec
-ligula ipsum. Nunc augue lacus, ullamcorper vel dapibus in, mattis eget elit.
-
-> main = print $ reverse' [1 .. 10]
-
-Integer ut dui eu felis mollis vestibulum. Etiam at nibh id diam aliquet
-vestibulum sit amet a nibh. Aliquam erat volutpat. Etiam vitae nulla at dolor
-fringilla tempor ut a nunc. Pellentesque elementum elit lorem.
diff --git a/data/example/contact.markdown b/data/example/contact.markdown
new file mode 100644
index 0000000..78e8698
--- /dev/null
+++ b/data/example/contact.markdown
@@ -0,0 +1,6 @@
+---
+title: Contact
+---
+
+I live in a small hut in the mountains of Kumano Kodō on Kii Hantō and would not
+like to be contacted.
diff --git a/data/example/css/default.css b/data/example/css/default.css
index 9eb8a27..6efd0dd 100644
--- a/data/example/css/default.css
+++ b/data/example/css/default.css
@@ -41,12 +41,16 @@ div#footer {
text-align: right;
}
-div.figure {
- float: right;
- margin: 20px 0px 20px 20px;
+h1 {
+ font-size: 24px;
}
-div.figure p.caption {
- text-align: center;
+h2 {
+ font-size: 20px;
+}
+
+div.info {
+ color: #555;
+ font-size: 14px;
font-style: italic;
}
diff --git a/data/example/css/syntax.css b/data/example/css/syntax.css
deleted file mode 100644
index 1aed859..0000000
--- a/data/example/css/syntax.css
+++ /dev/null
@@ -1,18 +0,0 @@
-/* Generated by pandoc. */
-table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode, table.sourceCode pre
- { margin: 0; padding: 0; border: 0; vertical-align: baseline; border: none; }
-td.lineNumbers { border-right: 1px solid #AAAAAA; text-align: right; color: #AAAAAA; padding-right: 5px; padding-left: 5px; }
-td.sourceCode { padding-left: 5px; }
-pre.sourceCode span.kw { color: #007020; font-weight: bold; }
-pre.sourceCode span.dt { color: #902000; }
-pre.sourceCode span.dv { color: #40a070; }
-pre.sourceCode span.bn { color: #40a070; }
-pre.sourceCode span.fl { color: #40a070; }
-pre.sourceCode span.ch { color: #4070a0; }
-pre.sourceCode span.st { color: #4070a0; }
-pre.sourceCode span.co { color: #60a0b0; font-style: italic; }
-pre.sourceCode span.ot { color: #007020; }
-pre.sourceCode span.al { color: red; font-weight: bold; }
-pre.sourceCode span.fu { color: #06287e; }
-pre.sourceCode span.re { }
-pre.sourceCode span.er { color: red; font-weight: bold; }
diff --git a/data/example/index.html b/data/example/index.html
new file mode 100644
index 0000000..950111c
--- /dev/null
+++ b/data/example/index.html
@@ -0,0 +1,19 @@
+---
+title: Home
+---
+
+<h2>Welcome</h2>
+
+<img src="/images/haskell-logo.png" style="float: right; margin: 10px;" />
+
+<p>Welcome to my blog!</p>
+
+<p>I've reproduced a list of recent posts here for your reading pleasure:</p>
+
+<h2>Posts</h2>
+
+<ul>
+ $posts$
+</ul>
+
+<p>…or you can find more in the <a href="/archive.html">archives</a>.
diff --git a/data/example/index.markdown b/data/example/index.markdown
deleted file mode 100644
index 96b63bd..0000000
--- a/data/example/index.markdown
+++ /dev/null
@@ -1,27 +0,0 @@
----
-title: Home
----
-Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce tempor, urna et
-auctor tincidunt, eros mauris facilisis purus, eget sollicitudin leo massa sit
-amet ipsum. Vivamus eu massa in urna vehicula rutrum eget sit amet purus.
-
-![Haskell logo](/images/haskell-logo.png)
-
-- Mauris sit amet justo mi.
-- Curabitur vel quam felis.
-- In hac habitasse platea dictumst.
-
-Etiam nec consequat risus. Donec consequat est vitae neque fermentum
-feugiat nec ac nibh. Nulla rhoncus, odio quis scelerisque rutrum, metus sem
-tempor ante, a ornare ipsum felis sed ligula. Morbi urna lectus, scelerisque
-non pharetra in, rutrum quis ligula. Phasellus semper ullamcorper arcu eu
-auctor.
-
-Aliquam sagittis tincidunt libero ut elementum. Ut sit amet vestibulum metus.
-Ut aliquet congue neque eu tincidunt. Integer eu elit sed massa sollicitudin
-vehicula nec ut sem. Cras euismod enim eget purus lacinia non feugiat urna
-imperdiet. Aliquam justo sem, viverra eu vehicula vitae, imperdiet vel magna.
-
-Pellentesque enim dui, interdum elementum vehicula luctus, feugiat vitae arcu.
-Vestibulum ut felis justo. Quisque vestibulum mauris eget ipsum luctus
-consequat.
diff --git a/data/example/posts/2012-08-12-spqr.markdown b/data/example/posts/2012-08-12-spqr.markdown
new file mode 100644
index 0000000..3704aa5
--- /dev/null
+++ b/data/example/posts/2012-08-12-spqr.markdown
@@ -0,0 +1,59 @@
+---
+title: S.P.Q.R.
+---
+
+Mauris in lorem nisl. Maecenas tempus facilisis ante, eget viverra nisl
+tincidunt et. Donec turpis lectus, mattis ac malesuada a, accumsan eu libero.
+Morbi condimentum, tortor et tincidunt ullamcorper, sem quam pretium nulla, id
+convallis lectus libero nec turpis. Proin dapibus nisi id est sodales nec
+ultrices tortor pellentesque. Vivamus vel nisi ac lacus sollicitudin vulputate
+ac ut ligula. Nullam feugiat risus eget eros gravida in molestie sapien euismod.
+Nunc sed hendrerit orci. Nulla mollis consequat lorem ac blandit. Ut et turpis
+mauris. Nulla est odio, posuere id ullamcorper sit amet, tincidunt vel justo.
+Curabitur placerat tincidunt varius. Nulla vulputate, ipsum eu consectetur
+mollis, dui nibh aliquam neque, at ultricies leo ligula et arcu. Proin et mi
+eget tellus sodales lobortis. Sed tempor, urna vel pulvinar faucibus, lectus
+urna vehicula ante, at facilisis dolor odio at lorem. Morbi vehicula euismod
+urna, et imperdiet urna ornare vitae.
+
+Sed tincidunt sollicitudin ultrices. In hac habitasse platea dictumst. Morbi
+ligula lectus, egestas at ultricies nec, fringilla et tellus. Duis urna lorem,
+bibendum a ornare sed, euismod sed nunc. Aliquam tempor massa at velit fringilla
+fringilla. Praesent sit amet tempor felis. Maecenas id felis ac velit aliquam
+tempor a sit amet orci. Nunc placerat nulla pellentesque sem commodo cursus.
+Praesent quis sapien orci, quis ultricies augue. Nam vestibulum sem non augue
+semper tincidunt pellentesque ipsum volutpat. Duis congue, nunc a aliquam
+luctus, quam ante convallis nisi, ac pellentesque lacus orci vel turpis. Cum
+sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus
+mus. Suspendisse hendrerit nisl eu felis sagittis faucibus. Nunc eu congue
+lorem. Quisque non nibh nisi, et ultrices massa. Sed vitae erat vitae nulla
+pellentesque fermentum.
+
+Ut diam nunc, consectetur ut ultrices eu, iaculis sed felis. Sed lacinia, odio
+et accumsan luctus, arcu ipsum accumsan erat, sit amet malesuada libero lacus et
+velit. Donec accumsan tristique tristique. Proin a metus magna, vitae mattis
+nisl. Integer a libero ipsum. Mauris faucibus eleifend metus id sodales. Morbi
+ornare, nibh nec facilisis imperdiet, turpis sem commodo lorem, id commodo
+mauris metus vitae justo. Etiam at pellentesque tortor. Proin mollis accumsan
+ligula, nec tempus augue auctor quis. Nulla lacinia, mi quis lobortis auctor,
+nisi diam posuere dui, pulvinar feugiat dui libero eget quam. Fusce eu risus
+nunc, a consectetur orci. Class aptent taciti sociosqu ad litora torquent per
+conubia nostra, per inceptos himenaeos. Maecenas venenatis aliquet orci, a
+ultricies sem facilisis eu. Donec dolor purus, porta condimentum convallis nec,
+dignissim nec libero.
+
+Etiam rutrum ultricies dui, et interdum metus elementum et. Nulla sapien nunc,
+interdum tristique porttitor in, laoreet vitae mi. Ut vehicula auctor mauris sit
+amet bibendum. Phasellus adipiscing mattis libero, eget adipiscing erat
+dignissim at. Vivamus convallis malesuada metus nec cursus. Ut cursus, lorem
+eleifend sollicitudin condimentum, felis tortor sodales augue, ac tempus lacus
+ipsum vitae quam. Vestibulum vitae lacus non tortor vehicula iaculis faucibus
+quis massa.
+
+Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus
+mus. Duis malesuada neque nec ante porttitor accumsan. Suspendisse potenti.
+Aliquam in lacus magna, imperdiet laoreet lectus. Praesent id diam nec ante
+commodo rhoncus nec vel augue. Pellentesque tortor massa, dignissim ut sagittis
+sed, hendrerit vitae nunc. Nam gravida, urna vitae hendrerit rutrum, felis augue
+vulputate tortor, ut varius velit libero nec lectus. In adipiscing massa in est
+scelerisque ullamcorper. Vivamus in nisi metus.
diff --git a/data/example/posts/2012-10-07-rosa-rosa-rosam.markdown b/data/example/posts/2012-10-07-rosa-rosa-rosam.markdown
new file mode 100644
index 0000000..01afcdb
--- /dev/null
+++ b/data/example/posts/2012-10-07-rosa-rosa-rosam.markdown
@@ -0,0 +1,45 @@
+---
+title: Rosa Rosa Rosam
+---
+
+Suspendisse pharetra ullamcorper sem et auctor. Suspendisse vitae tellus eu
+turpis dignissim gravida ut ut tortor. Cum sociis natoque penatibus et magnis
+dis parturient montes, nascetur ridiculus mus. Morbi aliquam sapien quis nisl
+sodales non aliquet nisl iaculis. Curabitur fermentum orci vel sapien
+pellentesque id condimentum metus vehicula. Curabitur turpis purus, scelerisque
+at interdum quis, placerat sit amet tortor. Aliquam erat volutpat.
+
+Integer posuere felis non arcu suscipit ullamcorper. Nam tempus risus venenatis
+orci sagittis eu aliquam ante tincidunt. Aenean vehicula ipsum id sapien
+tincidunt commodo. Aliquam erat volutpat. Curabitur vehicula libero ac turpis
+cursus consectetur. Praesent posuere egestas purus et dapibus. Mauris egestas,
+lectus vitae scelerisque ultricies, metus lorem tempor nisi, sed vehicula tortor
+mauris nec urna. Quisque urna tellus, facilisis at mollis eget, adipiscing in
+nisl. Proin quam arcu, euismod et imperdiet sed, ultricies sed orci.
+
+Nulla malesuada sem eget lectus scelerisque nec rhoncus metus interdum. In dui
+felis, rhoncus id scelerisque eget, vulputate id sem. Nulla facilisi. Vestibulum
+eleifend, metus dignissim lacinia ornare, magna nulla vehicula nisi, sed
+molestie mauris ipsum vel turpis. Class aptent taciti sociosqu ad litora
+torquent per conubia nostra, per inceptos himenaeos. Nulla urna leo, vehicula
+eget dignissim a, hendrerit ut risus. Fusce ultricies elementum placerat. Nam at
+dolor sed nisi mollis sollicitudin vitae at urna. Vestibulum iaculis adipiscing
+eros et mollis.
+
+Phasellus ultricies elit eu risus sagittis eu dictum ante ultrices. Nulla
+congue, augue ac placerat tempor, orci mi luctus nisi, at varius ipsum sem sed
+eros. Vivamus eget velit eget felis posuere ornare. In sed metus non est iaculis
+facilisis dapibus sit amet enim. Aliquam viverra tortor eget neque volutpat in
+auctor urna rutrum. Aliquam ligula augue, congue sit amet rutrum in, semper vel
+nulla. Sed tempus porttitor faucibus. Donec cursus sodales nulla, quis lacinia
+mi vehicula vel. Sed nec purus orci. Nam leo sapien, rutrum a ultrices quis,
+placerat vel ligula. Donec massa quam, pellentesque et molestie nec, hendrerit
+id mauris. In hac habitasse platea dictumst. Cras quis quam sem. Curabitur in
+arcu diam, in interdum mauris.
+
+Proin lorem sapien, iaculis et faucibus nec, dictum sed nunc. Pellentesque in
+purus justo. Vestibulum facilisis rutrum nisi, a egestas nunc suscipit sed. Ut
+quis tortor a arcu bibendum placerat non sed ante. Praesent orci sem, posuere
+sit amet cursus molestie, volutpat ut purus. Curabitur aliquam, purus in
+pharetra viverra, lorem leo aliquam tellus, vel consequat felis neque et mauris.
+Aliquam erat volutpat.
diff --git a/data/example/posts/2012-11-28-carpe-diem.markdown b/data/example/posts/2012-11-28-carpe-diem.markdown
new file mode 100644
index 0000000..bd115da
--- /dev/null
+++ b/data/example/posts/2012-11-28-carpe-diem.markdown
@@ -0,0 +1,50 @@
+---
+title: Carpe Diem
+---
+
+Fusce tortor quam, egestas in posuere quis, porttitor vel turpis. Donec
+vulputate porttitor augue at rhoncus. Proin iaculis consectetur sagittis.
+Curabitur venenatis turpis sit amet purus tristique nec posuere risus laoreet.
+Nullam nisi sem, dapibus id semper id, egestas vel arcu. Morbi porttitor ipsum
+placerat erat consequat sed consequat purus feugiat. Donec auctor elit ut risus
+mattis facilisis. Lorem ipsum dolor sit amet, consectetur adipiscing elit.
+
+Proin vulputate sapien facilisis leo ornare pulvinar. Fusce tempus massa a risus
+semper iaculis. Suspendisse sollicitudin posuere nunc, sit amet rutrum leo
+facilisis mattis. Sed ornare auctor dui, vitae rutrum neque auctor sit amet.
+Proin ac dui magna. Mauris vehicula interdum augue, nec ultrices libero egestas
+quis. Nunc convallis euismod ipsum, id sollicitudin orci consequat ac. Fusce
+bibendum congue libero, in rutrum nulla congue non. Cras sit amet risus tortor,
+eu pellentesque dui. Phasellus euismod enim non nibh sodales quis consectetur
+lorem laoreet. Vivamus a egestas quam. Curabitur in tortor augue, vitae varius
+tellus. Integer varius, elit ac gravida suscipit, eros erat pellentesque nisi,
+et tristique augue odio id nulla. Aliquam sit amet nunc vel tellus hendrerit
+tempus ac vel sem.
+
+Aenean tincidunt sollicitudin sapien ut porttitor. Curabitur molestie adipiscing
+lorem vel scelerisque. Donec vitae interdum est. Proin rutrum vulputate
+faucibus. Suspendisse sit amet felis odio, non volutpat ante. Sed eu lectus
+quam. Curabitur tristique rhoncus est, vel commodo tortor suscipit semper.
+Maecenas feugiat vestibulum nisi id facilisis. Nulla non tincidunt libero.
+Praesent ultrices interdum commodo. Sed euismod nisl auctor leo ultrices rutrum.
+Aliquam nibh felis, congue molestie blandit at, bibendum at eros. Aenean
+tincidunt, tortor iaculis placerat sollicitudin, lorem justo tempor diam, et
+posuere sapien leo et magna. Quisque vel aliquam mauris.
+
+Proin varius tempus fermentum. Cum sociis natoque penatibus et magnis dis
+parturient montes, nascetur ridiculus mus. Sed tincidunt nunc id magna
+adipiscing non sollicitudin turpis tempor. Etiam vel elit ipsum, quis euismod
+velit. Quisque elementum magna vitae quam venenatis lacinia. Sed at arcu ipsum.
+Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos
+himenaeos. Donec ut lorem ac sapien cursus lacinia sit amet mollis dolor.
+Vivamus tempus odio nec magna faucibus sed hendrerit lorem tempor.
+
+Vestibulum eu nisi arcu. Curabitur nisi risus, fermentum ut lacinia ut, interdum
+nec magna. Nunc aliquet gravida massa, eu aliquam lorem faucibus at. Sed
+sollicitudin volutpat velit id tempor. In nibh justo, pharetra et pretium
+dignissim, tempus in turpis. Phasellus eget lobortis nisl. Phasellus sed
+fermentum diam. Nam tempus pharetra odio, quis congue eros imperdiet eu. Aliquam
+dui eros, hendrerit et vulputate vel, porta eu eros. Nullam nisi dui, commodo
+eget pharetra ut, ornare sit amet nunc. Fusce vel neque urna. Maecenas nulla
+ante, egestas at consequat quis, fermentum a enim. Aliquam id tristique urna.
+Integer augue justo, scelerisque et consectetur id, rhoncus eget enim.
diff --git a/data/example/posts/2012-11-28-example-post.markdown b/data/example/posts/2012-11-28-example-post.markdown
deleted file mode 100644
index 9b09631..0000000
--- a/data/example/posts/2012-11-28-example-post.markdown
+++ /dev/null
@@ -1,5 +0,0 @@
----
-title: An example post
----
-
-This is an example post.
diff --git a/data/example/posts/2012-12-07-running-hakyll.markdown b/data/example/posts/2012-12-07-running-hakyll.markdown
deleted file mode 100644
index cc1ea65..0000000
--- a/data/example/posts/2012-12-07-running-hakyll.markdown
+++ /dev/null
@@ -1,7 +0,0 @@
----
-title: Up and running with Hakyll!
----
-
-# Up and running with Hakyll!
-
-Congratulations, you succesfully compiled your Hakyll blog.
diff --git a/data/example/posts/2012-12-07-tu-quoque.markdown b/data/example/posts/2012-12-07-tu-quoque.markdown
new file mode 100644
index 0000000..16c12ec
--- /dev/null
+++ b/data/example/posts/2012-12-07-tu-quoque.markdown
@@ -0,0 +1,57 @@
+---
+title: Tu Quoque
+---
+
+Vestibulum leo turpis, dignissim quis ultrices sit amet, iaculis ac ligula.
+Pellentesque tristique, velit eget scelerisque scelerisque, est dolor ultrices
+arcu, quis ullamcorper justo arcu luctus mauris. Integer congue molestie nisi id
+posuere. Fusce pellentesque gravida tempus. Integer viverra tortor nec eros
+mollis quis convallis sem laoreet. Nulla id libero ac erat varius laoreet. Proin
+sed est est. Curabitur lacinia fermentum lorem, elementum malesuada ipsum
+malesuada ut. Donec suscipit elit id leo vehicula mattis non sed leo. Morbi
+varius eleifend varius. Nulla vestibulum, neque vitae aliquam eleifend, nisi
+tellus placerat nunc, quis suscipit elit turpis eu tortor. Etiam euismod
+convallis lectus quis venenatis. Phasellus laoreet magna in nibh cursus eu
+egestas nulla convallis. Aliquam vel ullamcorper risus. Fusce dictum, massa id
+consequat viverra, nulla ante tristique est, a faucibus nisi enim nec dui. Donec
+metus ligula, condimentum at porttitor eget, lobortis at quam.
+
+Aenean vel libero in magna ultricies congue in a odio. Donec faucibus rutrum
+ornare. Fusce dictum eleifend fermentum. Vestibulum vel nibh a metus porttitor
+rhoncus. Pellentesque id quam neque, eget molestie arcu. Integer in elit vel
+neque viverra ultricies in eget massa. Nam ut convallis est. Pellentesque eros
+eros, sodales non vehicula et, tincidunt ut odio. Cras suscipit ultrices metus
+sit amet molestie. Fusce enim leo, vehicula sed sodales quis, adipiscing at
+ipsum.
+
+Nunc tempor dignissim enim, sed tincidunt eros bibendum quis. Curabitur et dolor
+augue, id laoreet mi. Nulla cursus felis id dui vehicula vitae ornare lorem
+blandit. Cras eget dui nec odio volutpat pharetra. Fusce hendrerit justo justo,
+vel imperdiet enim. Vivamus elit risus, interdum ultrices accumsan eleifend,
+vestibulum vitae sapien. Integer bibendum ullamcorper tristique. Nulla quis odio
+lectus, quis eleifend augue. Integer a ligula mauris. Aenean et tempus tortor.
+Quisque at tortor mi. Vivamus accumsan feugiat est a blandit. Sed vitae enim ut
+dolor semper sodales. Duis tristique, ante et placerat elementum, nulla tellus
+pellentesque sapien, quis posuere velit mi eget nulla. Sed vestibulum nunc non
+est porttitor ut rutrum nibh semper. Pellentesque habitant morbi tristique
+senectus et netus et malesuada fames ac turpis egestas.
+
+Nulla adipiscing ultricies lobortis. Vivamus iaculis nisl vitae tellus laoreet
+vitae aliquet lacus mollis. Phasellus ut lacus urna, sed sagittis ante. Etiam
+consectetur pretium nisl sed dignissim. Pellentesque convallis, nisl eget
+commodo mollis, sem magna consequat arcu, sed pretium ipsum arcu sit amet neque.
+Aliquam erat volutpat. Morbi sed mi sed urna vestibulum placerat vitae vel
+metus. Fusce ac ante at justo pharetra vehicula. Vivamus vel tortor eget augue
+aliquet aliquet at vel odio. Nunc venenatis, magna quis facilisis fringilla,
+augue tellus varius neque, in vulputate est eros ut tortor. Duis lorem neque,
+aliquam congue posuere id, condimentum non dui. Phasellus ut dui massa,
+porttitor suscipit augue. Praesent quis tellus quam, vel volutpat metus. Vivamus
+enim est, aliquam in imperdiet et, sagittis eu ligula. Vestibulum hendrerit
+placerat orci et aliquet. Cras pharetra, dolor placerat lobortis tempor, metus
+odio cursus ligula, et posuere lacus ligula quis dui.
+
+Donec a lectus eu nibh malesuada aliquam. Proin at metus quam, et tincidunt leo.
+Quisque lacus justo, scelerisque sodales pulvinar sed, dignissim ut sapien.
+Vivamus diam felis, adipiscing sollicitudin ultricies id, accumsan ac felis. In
+eu posuere ligula. Suspendisse potenti. Donec porttitor dictum dui id vehicula.
+Integer ante velit, congue id dictum et, adipiscing a tortor.
diff --git a/data/example/site.hs b/data/example/site.hs
index ccf8ff8..5f064e8 100644
--- a/data/example/site.hs
+++ b/data/example/site.hs
@@ -1,8 +1,8 @@
--------------------------------------------------------------------------------
{-# LANGUAGE OverloadedStrings #-}
-import Hakyll
-import Data.List (sort)
-import Control.Applicative ((<$>))
+import Control.Applicative ((<$>))
+import Data.Monoid (mappend)
+import Hakyll
--------------------------------------------------------------------------------
@@ -16,7 +16,7 @@ main = hakyll $ do
route idRoute
compile compressCssCompiler
- match (fromList ["about.rst", "code.lhs"]) $ do
+ match (fromList ["about.rst", "contact.markdown"]) $ do
route $ setExtension "html"
compile $ pageCompiler
>>= requireApplyTemplate "templates/default.html" defaultContext
@@ -28,16 +28,48 @@ main = hakyll $ do
post <- pageCompiler
saveSnapshot "content" post
return post
- >>= requireApplyTemplate "templates/default.html" defaultContext
+ >>= requireApplyTemplate "templates/post.html" postCtx
+ >>= requireApplyTemplate "templates/default.html" postCtx
>>= relativizeUrls
+ match "archive.html" $ do
+ route idRoute
+ compile $ do
+ let archiveCtx =
+ field "posts" (\_ -> postList recentFirst) `mappend`
+ constField "title" "Archives" `mappend`
+ defaultContext
+
+ makeItem ""
+ >>= requireApplyTemplate "templates/archive.html" archiveCtx
+ >>= requireApplyTemplate "templates/default.html" archiveCtx
+ >>= relativizeUrls
+
+
match "index.html" $ do
route idRoute
compile $ do
- posts <- sort <$> getMatches "posts/*"
- post <- requireSnapshot (head posts) "content"
- return post
- >>= requireApplyTemplate "templates/default.html" defaultContext
+ let indexCtx = field "posts" $ \_ -> postList (take 3 . recentFirst)
+
+ getResourceBody
+ >>= applySelf indexCtx
+ >>= requireApplyTemplate "templates/default.html" postCtx
>>= relativizeUrls
match "templates/*" $ compile templateCompiler
+
+
+--------------------------------------------------------------------------------
+postCtx :: Context String
+postCtx =
+ dateField "date" "%B %e, %Y" `mappend`
+ defaultContext
+
+
+--------------------------------------------------------------------------------
+postList :: ([Item String] -> [Item String]) -> Compiler String
+postList preprocess = do
+ posts <- preprocess <$> requireAll "posts/*"
+ itemTpl <- requireBody "templates/post-item.html"
+ list <- applyTemplateList itemTpl postCtx posts
+ return list
diff --git a/data/example/templates/archive.html b/data/example/templates/archive.html
new file mode 100644
index 0000000..bc732f9
--- /dev/null
+++ b/data/example/templates/archive.html
@@ -0,0 +1,3 @@
+<ul>
+ $posts$
+</ul>
diff --git a/data/example/templates/default.html b/data/example/templates/default.html
index 4b7d8af..cd20808 100644
--- a/data/example/templates/default.html
+++ b/data/example/templates/default.html
@@ -4,9 +4,8 @@
<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>MyAweSomeCompany - $title$</title>
+ <title>My Hakyll Blog - $title$</title>
<link rel="stylesheet" type="text/css" href="/css/default.css" />
- <link rel="stylesheet" type="text/css" href="/css/syntax.css" />
</head>
<body>
<div id="header">
@@ -16,11 +15,14 @@
<div id="navigation">
<a href="/">Home</a>
<a href="/about.html">About</a>
- <a href="/code.html">Code</a>
+ <a href="/contact.html">Contact</a>
+ <a href="/archive.html">Archive</a>
</div>
</div>
<div id="content">
+ <h1>$title$</h1>
+
$body$
</div>
<div id="footer">
diff --git a/data/example/templates/post-item.html b/data/example/templates/post-item.html
new file mode 100644
index 0000000..decbc33
--- /dev/null
+++ b/data/example/templates/post-item.html
@@ -0,0 +1,3 @@
+<li>
+ <a href="$url$">$title$</a> - $date$
+</li>
diff --git a/data/example/templates/post.html b/data/example/templates/post.html
new file mode 100644
index 0000000..4b39962
--- /dev/null
+++ b/data/example/templates/post.html
@@ -0,0 +1,3 @@
+<div class="info">Posted on $date$</div>
+
+$body$