summaryrefslogtreecommitdiff
path: root/data
diff options
context:
space:
mode:
authorJasper Van der Jeugt <m@jaspervdj.be>2012-12-07 11:36:20 +0100
committerJasper Van der Jeugt <m@jaspervdj.be>2012-12-07 11:36:20 +0100
commit251e1126c38eafca2890c3bfd268956624cf3397 (patch)
tree32b67ab1d49b9549809db3fae7946fbb0e3e6336 /data
parent7d20671bb3ff7b970ff7556ed18fd5714ab962da (diff)
downloadhakyll-251e1126c38eafca2890c3bfd268956624cf3397.tar.gz
Bit of work on example site
Diffstat (limited to 'data')
-rw-r--r--data/example/css/default.css43
-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/site.hs22
-rw-r--r--data/example/templates/default.html22
5 files changed, 83 insertions, 16 deletions
diff --git a/data/example/css/default.css b/data/example/css/default.css
index 3bfeeaf..9eb8a27 100644
--- a/data/example/css/default.css
+++ b/data/example/css/default.css
@@ -1,19 +1,44 @@
body {
- width: 600px;
+ color: black;
+ font-size: 16px;
margin: 0px auto 0px auto;
+ width: 600px;
}
-div#navigation {
- text-align: center;
- border-bottom: 4px solid black;
+div#header {
+ border-bottom: 2px solid black;
+ margin-bottom: 30px;
+ padding: 12px 0px 12px 0px;
+}
+
+div#logo a {
+ color: black;
+ float: left;
+ font-size: 18px;
+ font-weight: bold;
+ text-decoration: none;
+}
+
+div#header #navigation {
+ text-align: right;
}
-div#navigation a {
- color: white;
+div#header #navigation a {
+ color: black;
+ font-size: 18px;
+ font-weight: bold;
+ margin-left: 12px;
text-decoration: none;
- background-color: black;
- padding: 3px 10px 3px 10px;
- margin: 0px 10px 0px 10px;
+ text-transform: uppercase;
+}
+
+div#footer {
+ border-top: solid 2px black;
+ color: #555;
+ font-size: 12px;
+ margin-top: 30px;
+ padding: 12px 0px 12px 0px;
+ text-align: right;
}
div.figure {
diff --git a/data/example/posts/2012-11-28-example-post.markdown b/data/example/posts/2012-11-28-example-post.markdown
new file mode 100644
index 0000000..9b09631
--- /dev/null
+++ b/data/example/posts/2012-11-28-example-post.markdown
@@ -0,0 +1,5 @@
+---
+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
new file mode 100644
index 0000000..cc1ea65
--- /dev/null
+++ b/data/example/posts/2012-12-07-running-hakyll.markdown
@@ -0,0 +1,7 @@
+---
+title: Up and running with Hakyll!
+---
+
+# Up and running with Hakyll!
+
+Congratulations, you succesfully compiled your Hakyll blog.
diff --git a/data/example/site.hs b/data/example/site.hs
index df53095..ccf8ff8 100644
--- a/data/example/site.hs
+++ b/data/example/site.hs
@@ -1,6 +1,8 @@
--------------------------------------------------------------------------------
{-# LANGUAGE OverloadedStrings #-}
import Hakyll
+import Data.List (sort)
+import Control.Applicative ((<$>))
--------------------------------------------------------------------------------
@@ -14,10 +16,28 @@ main = hakyll $ do
route idRoute
compile compressCssCompiler
- match (fromList ["about.rst", "index.markdown", "code.lhs"]) $ do
+ match (fromList ["about.rst", "code.lhs"]) $ do
route $ setExtension "html"
compile $ pageCompiler
>>= requireApplyTemplate "templates/default.html" defaultContext
>>= relativizeUrls
+ match "posts/*" $ do
+ route $ setExtension "html"
+ compile $ do
+ post <- pageCompiler
+ saveSnapshot "content" post
+ return post
+ >>= requireApplyTemplate "templates/default.html" defaultContext
+ >>= 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
+ >>= relativizeUrls
+
match "templates/*" $ compile templateCompiler
diff --git a/data/example/templates/default.html b/data/example/templates/default.html
index 44d1cd0..4b7d8af 100644
--- a/data/example/templates/default.html
+++ b/data/example/templates/default.html
@@ -9,13 +9,23 @@
<link rel="stylesheet" type="text/css" href="/css/syntax.css" />
</head>
<body>
- <h1>MyAweSomeCompany - $title$</h1>
- <div id="navigation">
- <a href="/">Home</a>
- <a href="/about.html">About</a>
- <a href="/code.html">Code</a>
+ <div id="header">
+ <div id="logo">
+ <a href="/">My Hakyll Blog</a>
+ </div>
+ <div id="navigation">
+ <a href="/">Home</a>
+ <a href="/about.html">About</a>
+ <a href="/code.html">Code</a>
+ </div>
</div>
- $body$
+ <div id="content">
+ $body$
+ </div>
+ <div id="footer">
+ Site proudly generated by
+ <a href="http://jaspervdj.be/hakyll">Hakyll</a>
+ </div>
</body>
</html>