-
$4.items
{-# LANGUAGE TransformListComp #-} module GalleryPage (make) where import Control.Exception import Data.Foldable import Data.Function (on, (&)) import qualified Data.HashMap.Strict as HashMap import Data.HashSet (HashSet) import qualified Data.HashSet as HashSet import Data.List (intersperse, groupBy, sortOn) import qualified Data.Text.Lazy as Lazy import System.FilePath ((>), takeDirectory, joinPath, splitPath) import GHC.Exts (Down (..), the) import BuilderQQ import Depend (thumbFile) import Info newtype NoThumb = NoThumb FilePath deriving stock Eq deriving anyclass Exception instance Show NoThumb where show (NoThumb dir) = "no thumbnail for " ++ dir make :: GalleryInfo -> [(FilePath, Info)] -> Lazy.Text make ginfo infos = toLazyText $ make' ginfo infos make' :: GalleryInfo -> [(FilePath, Info)] -> Builder make' (GalleryInfo {title, prefix, filters, hidden}) infos = [b|@0