Restrict imports in Lucid + use '<.>' to delimit filename and extension

This commit is contained in:
Tissevert 2020-03-23 09:40:41 +01:00
parent 5163d13ce8
commit 77fc715294

View file

@ -14,7 +14,7 @@ import Control.Monad.Reader (ReaderT, asks)
import qualified Data.Map as Map (elems)
import qualified Data.Text.Lazy.IO as TextIO (writeFile)
import DOM (page)
import Lucid
import Lucid (renderTextT)
import Pretty ((.$))
import System.FilePath.Posix ((</>), (<.>))
@ -22,12 +22,12 @@ articlesLists :: Monad m => Collection -> ReaderT Blog m [(FilePath, ArticlesLis
articlesLists (Collection {articlesFeatured, basePath, tag}) = do
limit <- take <$> (asks $skin.$previewArticlesCount)
return [
(basePath </> "index.html", ArticlesList {
(basePath </> "index" <.> "html", ArticlesList {
tagged = tag
, full = False
, featured = limit articlesFeatured
})
, (basePath </> "all.html", ArticlesList {
, (basePath </> "all" <.> "html", ArticlesList {
tagged = tag
, full = True
, featured = articlesFeatured