Skip to content
Browse files

Updated to latest Hakyll. More work on illustrations and content fort…

…hcoming.
  • Loading branch information...
1 parent dc13341 commit afc2b061f1bd0e63a1eaabaa9ba9f4d6e8c425c1 @liamoc committed Jul 24, 2011
Showing with 42 additions and 45 deletions.
  1. +0 −4 footer.markdown
  2. +26 −24 hakyll.hs
  3. +0 −1 header.markdown
  4. +1 −1 templates/cover.html
  5. +11 −9 templates/default.html
  6. +4 −6 templates/toc.html
View
4 footer.markdown
@@ -1,4 +0,0 @@
---- footer
-Copyright © Liam O'Connor 2010. CC/BY
-
-Site Generated by [Hakyll](http://jaspervdj.be/hakyll/) and [Haskell](http://www.haskell.org).
View
50 hakyll.hs
@@ -1,27 +1,29 @@
#!/usr/bin/runhaskell
-import Text.Hakyll
-import Text.Hakyll.Render
-import Text.Hakyll.File
-import Text.Hakyll.CreateContext
-import Text.Pandoc.Shared
+{-# LANGUAGE OverloadedStrings #-}
+import Control.Arrow((>>>))
+import Hakyll
-withHeader = (`combine` createPage "header.markdown")
-withFooter = (`combine` createPage "footer.markdown")
+main = hakyll $ do
+ match "css/*" $ do
+ route idRoute
+ compile compressCssCompiler
+
+ match "static/*" $ do
+ route idRoute
+ compile copyFileCompiler
+
+ match "templates/*" $ do
+ compile templateCompiler
+
+ match "pages/*" $ do
+ route (setExtension "html")
+ compile $ pageCompiler >>> applyTemplateCompiler "templates/default.html" >>> relativizeUrlsCompiler
+
+ match "toc.md" $ do
+ route (setExtension "html")
+ compile $ pageCompiler >>> applyTemplateCompiler "templates/toc.html" >>> relativizeUrlsCompiler
+
+ match "index.md" $ do
+ route (setExtension "html")
+ compile $ pageCompiler >>> applyTemplateCompiler "templates/cover.html" >>> relativizeUrlsCompiler
-main = hakyllWithConfiguration conf $ do
- directory static "static"
- directory css "css"
- directory render "pages"
- renderCover "index.md"
- renderTOC "toc.md"
- where render = renderChain ["templates/default.html"]
- . withHeader
- . withFooter
- . createPage
- renderCover = renderChain ["templates/cover.html"]
- . createPage
- renderTOC = renderChain ["templates/toc.html"]
- . withHeader
- . withFooter
- . createPage
- conf = (defaultHakyllConfiguration "http://learnyouanagda.com") { pandocWriterOptions = defaultWriterOptions { writerHTMLMathMethod = GladTeX } }
View
1 header.markdown
@@ -1 +0,0 @@
---- header
View
2 templates/cover.html
@@ -8,6 +8,6 @@
<title>Learn you An Agda And Achieve Enlightenment</title>
</head>
<body>
-$body
+$body$
</body>
</html>
View
20 templates/default.html
@@ -4,32 +4,34 @@
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" >
<link rel="stylesheet" href="/css/style.css" />
-<title>Learn You An Agda - $title </title>
+<title>Learn You An Agda - $title$ </title>
</head>
<body>
<div class=container>
<div class='titleimage'>Learn you an Agda</div>
<div id="content">
<div class='header'>
<ul class=headerlist>
-<li style="text-align:left">$prev</li>
+<li style="text-align:left">$prev$</li>
<li style="text-align:center">
<a href="/toc.html">Table of Contents</a></li>
-<li style="text-align:right">$next</li>
+<li style="text-align:right">$next$</li>
</ul>
</div>
-<div class='title'>$title</div>
-<div class='date'>$date</div>
-$body
+<div class='title'>$title$</div>
+<div class='date'>$date$</div>
+$body$
<div class='header'>
<ul class=headerlist>
-<li style="text-align:left">$prev</li>
+<li style="text-align:left">$prev$</li>
<li style="text-align:center">
<a href="/toc.html">Table of Contents</a></li>
-<li style="text-align:right">$next</li>
+<li style="text-align:right">$next$</li>
</ul>
</div>
-<div class='footer'>$footer</div>
+<div class='footer'>
+Site Generated by <a href="http://jaspervdj.be/hakyll">Hakyll</a> and <a href=http://www.haskell.org>Haskell</a>.
+</div>
</div>
</div>
</body>
View
10 templates/toc.html
@@ -16,13 +16,11 @@
<body>
<div class=container>
<div class='titleimage'>Learn you an Agda</div>
-<div class='header'>
-$header
-</div>
<div id="content">
-<div class='title'>$title</div>
-$body
-<div class='footer'>$footer</div>
+<div class='title'>$title$</div>
+$body$
+<div class='footer'>
+Site Generated by <a href="http://jaspervdj.be/hakyll">Hakyll</a> and <a href=http://www.haskell.org>Haskell</a>.</div>
</div>
</div>
</body>

0 comments on commit afc2b06

Please sign in to comment.
Something went wrong with that request. Please try again.