From b468dcbf3343ea251703078ec89d3215116fc2f6 Mon Sep 17 00:00:00 2001 From: pacien Date: Tue, 25 Feb 2020 19:25:16 +0100 Subject: compiler: re-introduce gallery title --- compiler/src/Config.hs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'compiler/src/Config.hs') diff --git a/compiler/src/Config.hs b/compiler/src/Config.hs index 5f1806d..1bdb2b8 100644 --- a/compiler/src/Config.hs +++ b/compiler/src/Config.hs @@ -50,7 +50,8 @@ instance FromJSON TagsFromDirectoriesConfig where data GalleryConfig = GalleryConfig - { includedDirectories :: [String] + { galleryTitle :: String + , includedDirectories :: [String] , excludedDirectories :: [String] , includedFiles :: [String] , excludedFiles :: [String] @@ -61,7 +62,8 @@ data GalleryConfig = GalleryConfig instance FromJSON GalleryConfig where parseJSON = withObject "GalleryConfig" $ \v -> GalleryConfig - <$> v .:? "includedDirectories" .!= ["*"] + <$> v .:? "galleryTitle" .!= "ldgallery" + <*> v .:? "includedDirectories" .!= ["*"] <*> v .:? "excludedDirectories" .!= [] <*> v .:? "includedFiles" .!= ["*"] <*> v .:? "excludedFiles" .!= [] @@ -75,7 +77,8 @@ readConfig = decodeYamlFile data ViewerConfig = ViewerConfig { -- TODO: add viewer config keys (tag groups...) + galleryTitle :: String } deriving (Generic, ToJSON, Show) viewerConfig :: GalleryConfig -> ViewerConfig -viewerConfig _ = ViewerConfig -- TODO +viewerConfig GalleryConfig{galleryTitle} = ViewerConfig galleryTitle -- cgit v1.2.3