2022-03-19 00:59:36 +01:00
|
|
|
module Formats.Posts where
|
2022-03-25 13:35:31 +01:00
|
|
|
|
|
|
|
import Hakyll
|
|
|
|
import Util.Hakyll.Routes
|
|
|
|
import Data.Maybe (fromMaybe)
|
|
|
|
import Util.Hash (FileHashes)
|
|
|
|
import Debug.Trace
|
|
|
|
|
|
|
|
postRoute :: FileHashes -> Routes
|
|
|
|
postRoute hashes = titleRouteElseHash `composeRoutes` prefixRoute "posts/"
|
|
|
|
where
|
|
|
|
titleRouteElseHash :: Routes
|
|
|
|
titleRouteElseHash = metadataRoute $ \metadata -> fromMaybe (hashRoute hashes) $ titleRoute metadata
|