From c2f991bc3e9102b0bf849d56937b200aa731eb2a Mon Sep 17 00:00:00 2001 From: Rhiannon Morris Date: Sun, 19 Jul 2020 18:00:39 +0200 Subject: [PATCH] add gallery description --- make-pages/IndexPage.hs | 4 ++-- make-pages/Info.hs | 8 +++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/make-pages/IndexPage.hs b/make-pages/IndexPage.hs index 61b783d..a7e8583 100644 --- a/make-pages/IndexPage.hs +++ b/make-pages/IndexPage.hs @@ -50,8 +50,8 @@ make' (IndexInfo {title, galleries, links, footer}) = [b|@0 |] makeItem :: GalleryInfo -> Builder -makeItem (GalleryInfo {title, prefix, filters}) = [b|@4 - $*title +makeItem (GalleryInfo {title, description, prefix, filters}) = [b|@4 + $*title |] where nsfw = if hasNsfw filters then " class=nsfw" else "" diff --git a/make-pages/Info.hs b/make-pages/Info.hs index 84dfdef..2d82f8e 100644 --- a/make-pages/Info.hs +++ b/make-pages/Info.hs @@ -147,9 +147,10 @@ instance FromYAML Link where data GalleryInfo = GalleryInfo { - title :: !Text, - prefix :: !FilePath, - filters :: !GalleryFilters + title :: !Text, + description :: !Text, + prefix :: !FilePath, + filters :: !GalleryFilters } deriving (Eq, Show) @@ -189,6 +190,7 @@ matchFilters (GalleryFilters {nsfw, whose}) i = instance FromYAML GalleryInfo where parseYAML = YAML.withMap "gallery info" \m -> GalleryInfo <$> m .: "title" + <*> m .: "description" <*> m .: "prefix" <*> m .:? "filters" .!= noFilters