From 980d7908743527dd9d68cebaa80ab023e449b036 Mon Sep 17 00:00:00 2001 From: Rhiannon Morris Date: Sun, 19 Jul 2020 12:10:27 +0200 Subject: [PATCH] add title to index.yaml --- make-pages/IndexPage.hs | 8 ++++---- make-pages/Info.hs | 4 +++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/make-pages/IndexPage.hs b/make-pages/IndexPage.hs index d2813a7..47c53d9 100644 --- a/make-pages/IndexPage.hs +++ b/make-pages/IndexPage.hs @@ -7,19 +7,19 @@ import BuilderQQ import Info make :: IndexInfo -> Lazy.Text -make iinfo = toLazyText $ make' iinfo +make info = toLazyText $ make' info make' :: IndexInfo -> Builder -make' (IndexInfo {galleries, footer}) = [b|@0 +make' (IndexInfo {title, galleries, footer}) = [b|@0 - gallery list + $*title
-

gallery list

+

$*title

diff --git a/make-pages/Info.hs b/make-pages/Info.hs index 25a5594..14791b2 100644 --- a/make-pages/Info.hs +++ b/make-pages/Info.hs @@ -198,6 +198,7 @@ instance FromYAML Whose where parseYAML = YAML.withStr "whose" readWhose data IndexInfo = IndexInfo { + title :: !Text, galleries :: ![GalleryInfo], footer :: !Text } @@ -205,7 +206,8 @@ data IndexInfo = instance FromYAML IndexInfo where parseYAML = YAML.withMap "index info" \m -> - IndexInfo <$> m .:? "galleries" .!= [] + IndexInfo <$> m .: "title" + <*> m .:? "galleries" .!= [] <*> m .:? "footer" .!= ""