why did I not make it like this in the first place?
This commit is contained in:
parent
9fc9832618
commit
3107b23376
1 changed files with 3 additions and 9 deletions
12
src/Main.hs
12
src/Main.hs
|
@ -70,7 +70,9 @@ main = do
|
|||
let url = toFilePath ident
|
||||
compiled <- getResourceBody >>= renderPandoc
|
||||
let pageCtx = paginateContext pages num
|
||||
let ctx = (postCtx tags) <> pageCtx <> flattrCtx (urlEncode title) (urlEncode $ "https://nek0.eu/" ++ url)
|
||||
let flattrCtx = constField "enctitle" (urlEncode title) <>
|
||||
constField "encurl" (urlEncode $ "https://nek0.eu/" ++ url)
|
||||
let ctx = (postCtx tags) <> pageCtx <> flattrCtx
|
||||
full <- loadAndApplyTemplate "templates/post.html" ctx compiled
|
||||
_ <- saveSnapshot "content" compiled
|
||||
loadAndApplyTemplate "templates/default.html" baseCtx full
|
||||
|
@ -142,14 +144,6 @@ feedCtx = mconcat
|
|||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
flattrCtx :: String -> String -> Context String
|
||||
flattrCtx tit url = mconcat
|
||||
[ constField "enctitle" tit
|
||||
, constField "encurl" url
|
||||
]
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
feedConf :: FeedConfiguration
|
||||
feedConf = FeedConfiguration
|
||||
{ feedTitle = "nek0's blog"
|
||||
|
|
Loading…
Reference in a new issue