From 54790c6c73d7c51ff22cf5e9722b141cdc0249df Mon Sep 17 00:00:00 2001 From: pacien Date: Sat, 29 Feb 2020 16:39:55 +0100 Subject: compiler: add tagCategories setting to gallery.yaml --- compiler/src/Config.hs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'compiler/src') diff --git a/compiler/src/Config.hs b/compiler/src/Config.hs index 8796c3c..0ae0fa1 100644 --- a/compiler/src/Config.hs +++ b/compiler/src/Config.hs @@ -57,6 +57,7 @@ data GalleryConfig = GalleryConfig , excludedFiles :: [String] , includedTags :: [String] , excludedTags :: [String] + , tagCategories :: [String] , tagsFromDirectories :: TagsFromDirectoriesConfig , thumbnailMaxResolution :: Resolution , pictureMaxResolution :: Maybe Resolution @@ -71,6 +72,7 @@ instance FromJSON GalleryConfig where <*> v .:? "excludedFiles" .!= [] <*> v .:? "includedTags" .!= ["*"] <*> v .:? "excludedTags" .!= [] + <*> v .:? "tagCategories" .!= [] <*> v .:? "tagsFromDirectories" .!= (TagsFromDirectoriesConfig 0 "") <*> v .:? "thumbnailMaxResolution" .!= (Resolution 400 300) <*> v .:? "pictureMaxResolution" @@ -80,9 +82,9 @@ readConfig = decodeYamlFile data ViewerConfig = ViewerConfig - { -- TODO: add viewer config keys (tag groups...) - galleryTitle :: String + { galleryTitle :: String + , tagCategories :: [String] } deriving (Generic, ToJSON, Show) viewerConfig :: GalleryConfig -> ViewerConfig -viewerConfig GalleryConfig{galleryTitle} = ViewerConfig galleryTitle +viewerConfig GalleryConfig{galleryTitle, tagCategories} = ViewerConfig galleryTitle tagCategories -- cgit v1.2.3