aboutsummaryrefslogtreecommitdiff
path: root/compiler/src
diff options
context:
space:
mode:
authorpacien2020-02-25 19:25:16 +0100
committerNotkea2020-02-27 19:33:49 +0100
commitb468dcbf3343ea251703078ec89d3215116fc2f6 (patch)
tree3bf1a18762a399a2a98a81c14332a8dd244ad0ad /compiler/src
parent27a7bebc32a527cc86857008b491b9571e807183 (diff)
downloadldgallery-b468dcbf3343ea251703078ec89d3215116fc2f6.tar.gz
compiler: re-introduce gallery title
Diffstat (limited to 'compiler/src')
-rw-r--r--compiler/src/Config.hs9
1 files changed, 6 insertions, 3 deletions
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
50 50
51 51
52data GalleryConfig = GalleryConfig 52data GalleryConfig = GalleryConfig
53 { includedDirectories :: [String] 53 { galleryTitle :: String
54 , includedDirectories :: [String]
54 , excludedDirectories :: [String] 55 , excludedDirectories :: [String]
55 , includedFiles :: [String] 56 , includedFiles :: [String]
56 , excludedFiles :: [String] 57 , excludedFiles :: [String]
@@ -61,7 +62,8 @@ data GalleryConfig = GalleryConfig
61 62
62instance FromJSON GalleryConfig where 63instance FromJSON GalleryConfig where
63 parseJSON = withObject "GalleryConfig" $ \v -> GalleryConfig 64 parseJSON = withObject "GalleryConfig" $ \v -> GalleryConfig
64 <$> v .:? "includedDirectories" .!= ["*"] 65 <$> v .:? "galleryTitle" .!= "ldgallery"
66 <*> v .:? "includedDirectories" .!= ["*"]
65 <*> v .:? "excludedDirectories" .!= [] 67 <*> v .:? "excludedDirectories" .!= []
66 <*> v .:? "includedFiles" .!= ["*"] 68 <*> v .:? "includedFiles" .!= ["*"]
67 <*> v .:? "excludedFiles" .!= [] 69 <*> v .:? "excludedFiles" .!= []
@@ -75,7 +77,8 @@ readConfig = decodeYamlFile
75 77
76data ViewerConfig = ViewerConfig 78data ViewerConfig = ViewerConfig
77 { -- TODO: add viewer config keys (tag groups...) 79 { -- TODO: add viewer config keys (tag groups...)
80 galleryTitle :: String
78 } deriving (Generic, ToJSON, Show) 81 } deriving (Generic, ToJSON, Show)
79 82
80viewerConfig :: GalleryConfig -> ViewerConfig 83viewerConfig :: GalleryConfig -> ViewerConfig
81viewerConfig _ = ViewerConfig -- TODO 84viewerConfig GalleryConfig{galleryTitle} = ViewerConfig galleryTitle