fix path prefix

main
Oystein Kristoffer Tveit 2022-03-16 10:56:16 +01:00
parent 46d009ca0d
commit 01ed1a3308
1 changed files with 4 additions and 1 deletions

View File

@ -69,7 +69,7 @@ main = hakyllWith config $ do
match "posts/*" $ do match "posts/*" $ do
let ctx = constField "type" "article" <> postCtx let ctx = constField "type" "article" <> postCtx
route $ constRoute "posts/" <> metadataRoute titleRoute route $ metadataRoute titleRoute `composeRoutes` (prefixRoute "posts/")
compile $ compile $
pandocCompilerCustom pandocCompilerCustom
>>= loadAndApplyTemplate "templates/post.html" ctx >>= loadAndApplyTemplate "templates/post.html" ctx
@ -240,3 +240,6 @@ fileNameFromTitle =
titleRoute :: Metadata -> Routes titleRoute :: Metadata -> Routes
titleRoute = titleRoute =
constRoute . fileNameFromTitle constRoute . fileNameFromTitle
prefixRoute :: FilePath -> Routes
prefixRoute p = customRoute $ \id -> p ++ (toFilePath id)