-
$4.items
{-# LANGUAGE TransformListComp #-} module GalleryPage (make) where import Control.Exception import Data.Function (on, (&)) import Data.List (sortOn, groupBy) 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 :: Text -- ^ title -> FilePath -- ^ gallery url prefix -> Bool -- ^ nsfw is included? -> [(FilePath, Info)] -> Lazy.Text make title prefix nsfw infos = toLazyText $ make' title prefix nsfw infos make' :: Text -> FilePath -> Bool -> [(FilePath, Info)] -> Builder make' title prefix nsfw infos = [b|@0