h7x4
dcdf36f4dd
- Switch from `cabal2nix` and haskell overlay to `developPackage` - Restructure directories to have more descriptive names - Fix `nix run`
14 lines
403 B
Haskell
14 lines
403 B
Haskell
module Formats.Posts where
|
|
|
|
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
|