Skip to content

Commit

Permalink
Bit of work on example site
Browse files Browse the repository at this point in the history
  • Loading branch information
jaspervdj committed Dec 7, 2012
1 parent 7d20671 commit 251e112
Show file tree
Hide file tree
Showing 5 changed files with 83 additions and 16 deletions.
43 changes: 34 additions & 9 deletions data/example/css/default.css
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
5 changes: 5 additions & 0 deletions data/example/posts/2012-11-28-example-post.markdown
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
title: An example post
---

This is an example post.
7 changes: 7 additions & 0 deletions data/example/posts/2012-12-07-running-hakyll.markdown
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
title: Up and running with Hakyll!
---

# Up and running with Hakyll!

Congratulations, you succesfully compiled your Hakyll blog.
22 changes: 21 additions & 1 deletion data/example/site.hs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
--------------------------------------------------------------------------------
{-# LANGUAGE OverloadedStrings #-}
import Hakyll
import Data.List (sort)
import Control.Applicative ((<$>))


--------------------------------------------------------------------------------
Expand All @@ -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
22 changes: 16 additions & 6 deletions data/example/templates/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -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>

0 comments on commit 251e112

Please sign in to comment.