cleaned up some templating, still sucks tho
This commit is contained in:
parent
b050980644
commit
8136bdba81
13
index.html
13
index.html
@ -1,13 +0,0 @@
|
|||||||
---
|
|
||||||
title: Home
|
|
||||||
---
|
|
||||||
|
|
||||||
<p>please don't laugh at me i really like swatch internet time</p>
|
|
||||||
|
|
||||||
<p>here are some recent (for a very liberal definition of the word) posts:</p>
|
|
||||||
<p> - now only shows a few posts because im not dumb anymore - </p>
|
|
||||||
|
|
||||||
<h2>"Recent" Posts</h2>
|
|
||||||
$partial("templates/post-list.html")$
|
|
||||||
|
|
||||||
<p>…or for a chance to nab seven agenda points, check the <a href="/archive/index.html">archives</a>.</p>
|
|
11
index.md
Normal file
11
index.md
Normal file
@ -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
|
37
site.hs
37
site.hs
@ -67,6 +67,27 @@ main = do
|
|||||||
>>= relativizeUrls
|
>>= relativizeUrls
|
||||||
>>= cleanIndexUrls
|
>>= 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
|
-- Compile posts + save snapshots for the web feeds
|
||||||
match "posts/*" $ do
|
match "posts/*" $ do
|
||||||
route $ cleanRoute
|
route $ cleanRoute
|
||||||
@ -78,22 +99,6 @@ main = do
|
|||||||
>>= cleanIndexUrls
|
>>= cleanIndexUrls
|
||||||
>>= cleanIndexHtmls
|
>>= 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
|
-- Agnememnon the Fuck-Upperer - Conquerer of Small Type Declarations
|
||||||
compileFeed ::
|
compileFeed ::
|
||||||
(FeedConfiguration
|
(FeedConfiguration
|
||||||
|
4
templates/index.html
Normal file
4
templates/index.html
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
$body$
|
||||||
|
$partial("templates/post-list.html")$
|
||||||
|
|
||||||
|
<p>...or for a chance to nab seven agenda points, check the <a href="/archive/index.html">archives</a>.</p>
|
Loading…
Reference in New Issue
Block a user