瀏覽代碼

cleaned up some templating, still sucks tho

master
Shaun Kerr 5 年之前
父節點
當前提交
8136bdba81
共有 4 個檔案被更改,包括 32 行新增25 行删除
  1. +0
    -13
      index.html
  2. +11
    -0
      index.md
  3. +17
    -12
      site.hs
  4. +4
    -0
      templates/index.html

+ 0
- 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
- 0
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

+ 17
- 12
site.hs 查看文件

@@ -67,32 +67,37 @@ main = do
>>= relativizeUrls
>>= cleanIndexUrls

-- Compile posts + save snapshots for the web feeds
match "posts/*" $ do
route $ cleanRoute
-- Compile and load posts
match "index.md" $ do
route $ setExtension "html"
compile $ pandocCompiler
>>= loadAndApplyTemplate "templates/post.html" postCtx
>>= saveSnapshot "content"
>>= loadAndApplyTemplate "templates/default.html" postCtx
>>= loadAndApplyTemplate "templates/index.html" ctx
>>= relativizeUrls
>>= 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
pandocCompiler
>>= applyAsTemplate indexCtx
>>= loadAndApplyTemplate "templates/index.html" indexCtx
>>= loadAndApplyTemplate "templates/default.html" indexCtx
>>= relativizeUrls
>>= cleanIndexUrls
>>= cleanIndexHtmls

-- Compile posts + save snapshots for the web feeds
match "posts/*" $ do
route $ cleanRoute
compile $ pandocCompiler
>>= loadAndApplyTemplate "templates/post.html" postCtx
>>= saveSnapshot "content"
>>= loadAndApplyTemplate "templates/default.html" postCtx
>>= relativizeUrls
>>= cleanIndexUrls
>>= cleanIndexHtmls

-- Agnememnon the Fuck-Upperer - Conquerer of Small Type Declarations
compileFeed ::


+ 4
- 0
templates/index.html 查看文件

@@ -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…
取消
儲存