diff --git a/src/Dom.hs b/src/Dom.hs index 1e543b2..be787fb 100644 --- a/src/Dom.hs +++ b/src/Dom.hs @@ -21,15 +21,15 @@ import System.Posix.Files (modificationTime) data Page = Page { category :: Maybe String , full :: Bool - , urlPath :: FilePath + , filePath :: FilePath , articlesFeatured :: [Article] } previewArticle :: Article -> Html () -previewArticle article = +previewArticle (Article {urlPath}) = article_ (do - h1_ "Some Article" - pre_ . toHtml $ filePath article + h1_ $ a_ [href_ urlPath] "Some Article" + pre_ $ toHtml urlPath ) showTag :: String -> Html () @@ -66,19 +66,19 @@ generateCollection (category, path, articlesFeatured) = do blog <- ask liftIO $ createDirectoryIfMissing False path forM_ (pages $ previewCount blog) $ \page -> - liftIO $ renderToFile (urlPath page) (render page blog) + liftIO $ renderToFile (filePath page) (render page blog) where pages articlesCount = [ Page { category , full = True - , urlPath = path "all.html" + , filePath = path "all.html" , articlesFeatured } , Page { category , full = False - , urlPath = path "index.html" + , filePath = path "index.html" , articlesFeatured = take articlesCount articlesFeatured } ]