add a bare site
authorLucian Mogosanu <lucian.mogosanu@gmail.com>
Wed, 17 Jul 2013 06:27:20 +0000 (09:27 +0300)
committerLucian Mogosanu <lucian.mogosanu@gmail.com>
Wed, 17 Jul 2013 06:27:20 +0000 (09:27 +0300)
index.html [new file with mode: 0644]
site.hs
templates/default.html [new file with mode: 0644]

diff --git a/index.html b/index.html
new file mode 100644 (file)
index 0000000..a806adf
--- /dev/null
@@ -0,0 +1,5 @@
+---
+title: Home
+---
+
+The Tar Pit is cooking, please come back later.
diff --git a/site.hs b/site.hs
index 3549681..04c614f 100644 (file)
--- a/site.hs
+++ b/site.hs
@@ -2,4 +2,16 @@
 import           Data.Monoid (mappend)
 import           Hakyll
 
--- TODO: add site manually
+main :: IO ()
+main = hakyll $ do
+  match "index.html" $ do
+    route idRoute -- TODO: make a "copy to root" route?
+    compile $ do
+      let indexCtx = defaultContext
+
+      getResourceBody
+        >>= applyAsTemplate indexCtx
+        >>= loadAndApplyTemplate "templates/default.html" indexCtx
+        >>= relativizeUrls
+
+  match "templates/*" $ compile templateCompiler
diff --git a/templates/default.html b/templates/default.html
new file mode 100644 (file)
index 0000000..36d66c2
--- /dev/null
@@ -0,0 +1 @@
+$body$