diff --git a/index.html b/index.html deleted file mode 100644 index 0878d8f..0000000 --- a/index.html +++ /dev/null @@ -1,13 +0,0 @@ ---- -title: Home ---- - -
please don't laugh at me i really like swatch internet time
- -here are some recent (for a very liberal definition of the word) posts:
-- now only shows a few posts because im not dumb anymore -
- -…or for a chance to nab seven agenda points, check the archives.
diff --git a/index.md b/index.md new file mode 100644 index 0000000..0657cd4 --- /dev/null +++ b/index.md @@ -0,0 +1,11 @@ +--- +title: Home +--- + +please don't laugh at me i really like swatch internet time + +here are some recent (for a very liberal definition of the word) posts: + +> now actually only shows a few recent posts because im not as bad at haskell as i thought! + +## "Recent" Posts diff --git a/site.hs b/site.hs index 96adbc7..2ed25a8 100644 --- a/site.hs +++ b/site.hs @@ -67,6 +67,27 @@ main = do >>= relativizeUrls >>= cleanIndexUrls + -- Compile and load posts + match "index.md" $ do + route $ setExtension "html" + compile $ pandocCompiler + >>= loadAndApplyTemplate "templates/index.html" ctx + >>= relativizeUrls + >>= cleanIndexUrls + + compile $ do + posts <- (return . (take 5)) + =<< recentFirst + =<< loadAll "posts/*" + let indexCtx = + listField "posts" postCtx (return posts) <> ctx + pandocCompiler + >>= applyAsTemplate indexCtx + >>= loadAndApplyTemplate "templates/index.html" indexCtx + >>= loadAndApplyTemplate "templates/default.html" indexCtx + >>= relativizeUrls + >>= cleanIndexUrls + -- Compile posts + save snapshots for the web feeds match "posts/*" $ do route $ cleanRoute @@ -78,22 +99,6 @@ main = do >>= cleanIndexUrls >>= cleanIndexHtmls - -- Compile and load posts - match "index.html" $ do - route idRoute - compile $ do - posts <- (return . (take 5)) - =<< recentFirst - =<< loadAll "posts/*" - let indexCtx = - listField "posts" postCtx (return posts) <> ctx - getResourceBody - >>= applyAsTemplate indexCtx - >>= loadAndApplyTemplate "templates/default.html" indexCtx - >>= relativizeUrls - >>= cleanIndexUrls - >>= cleanIndexHtmls - -- Agnememnon the Fuck-Upperer - Conquerer of Small Type Declarations compileFeed :: (FeedConfiguration diff --git a/templates/index.html b/templates/index.html new file mode 100644 index 0000000..f063be0 --- /dev/null +++ b/templates/index.html @@ -0,0 +1,4 @@ +$body$ +$partial("templates/post-list.html")$ + +...or for a chance to nab seven agenda points, check the archives.