aboutsummaryrefslogtreecommitdiff
path: root/compiler
diff options
context:
space:
mode:
authorOzoneGrif2020-04-04 04:32:31 +0200
committerGitHub2020-04-04 04:32:31 +0200
commite3a1566aca42190d486ee73612b9275560e17aa1 (patch)
tree9df4e6be5dfa15a0d27024d6857845014d84f96d /compiler
parentf391a682dbd725c1d8aba9c571472bd390bb6a8d (diff)
parentc26ab69997d1d552fda72b8fd88d5910fc91b779 (diff)
downloadldgallery-e3a1566aca42190d486ee73612b9275560e17aa1.tar.gz
Merge branch 'develop' into oz-overflowing-titles
Diffstat (limited to 'compiler')
-rw-r--r--compiler/ldgallery.1.md6
-rw-r--r--compiler/src/Config.hs8
2 files changed, 10 insertions, 4 deletions
diff --git a/compiler/ldgallery.1.md b/compiler/ldgallery.1.md
index 3c52f9d..4f9935b 100644
--- a/compiler/ldgallery.1.md
+++ b/compiler/ldgallery.1.md
@@ -107,7 +107,7 @@ description
107 107
108tags 108tags
109: List of tags for the item. 109: List of tags for the item.
110 Tag groups can be defined using prefixes separated by ":" (colon). 110 Tag categories can be defined using prefixes separated by ":" (colon).
111 Tags specified in a directory metadata sidecar are applied to all items within that directory. 111 Tags specified in a directory metadata sidecar are applied to all items within that directory.
112 112
113 113
@@ -139,6 +139,10 @@ excludedTags[]
139: Glob patterns of tags to exclude from the gallery. 139: Glob patterns of tags to exclude from the gallery.
140 Defaults to [] (none). 140 Defaults to [] (none).
141 141
142tagCategories[]
143: Top-level tag categories.
144 Defaults to [] (none).
145
142tagsFromDirectories.fromParents 146tagsFromDirectories.fromParents
143: Automatically generate tags from the name of parent directories, 147: Automatically generate tags from the name of parent directories,
144 looking up in the hierarchy as far as indicated by this parameter. 148 looking up in the hierarchy as far as indicated by this parameter.
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
57 , excludedFiles :: [String] 57 , excludedFiles :: [String]
58 , includedTags :: [String] 58 , includedTags :: [String]
59 , excludedTags :: [String] 59 , excludedTags :: [String]
60 , tagCategories :: [String]
60 , tagsFromDirectories :: TagsFromDirectoriesConfig 61 , tagsFromDirectories :: TagsFromDirectoriesConfig
61 , thumbnailMaxResolution :: Resolution 62 , thumbnailMaxResolution :: Resolution
62 , pictureMaxResolution :: Maybe Resolution 63 , pictureMaxResolution :: Maybe Resolution
@@ -71,6 +72,7 @@ instance FromJSON GalleryConfig where
71 <*> v .:? "excludedFiles" .!= [] 72 <*> v .:? "excludedFiles" .!= []
72 <*> v .:? "includedTags" .!= ["*"] 73 <*> v .:? "includedTags" .!= ["*"]
73 <*> v .:? "excludedTags" .!= [] 74 <*> v .:? "excludedTags" .!= []
75 <*> v .:? "tagCategories" .!= []
74 <*> v .:? "tagsFromDirectories" .!= (TagsFromDirectoriesConfig 0 "") 76 <*> v .:? "tagsFromDirectories" .!= (TagsFromDirectoriesConfig 0 "")
75 <*> v .:? "thumbnailMaxResolution" .!= (Resolution 400 300) 77 <*> v .:? "thumbnailMaxResolution" .!= (Resolution 400 300)
76 <*> v .:? "pictureMaxResolution" 78 <*> v .:? "pictureMaxResolution"
@@ -80,9 +82,9 @@ readConfig = decodeYamlFile
80 82
81 83
82data ViewerConfig = ViewerConfig 84data ViewerConfig = ViewerConfig
83 { -- TODO: add viewer config keys (tag groups...) 85 { galleryTitle :: String
84 galleryTitle :: String 86 , tagCategories :: [String]
85 } deriving (Generic, ToJSON, Show) 87 } deriving (Generic, ToJSON, Show)
86 88
87viewerConfig :: GalleryConfig -> ViewerConfig 89viewerConfig :: GalleryConfig -> ViewerConfig
88viewerConfig GalleryConfig{galleryTitle} = ViewerConfig galleryTitle 90viewerConfig GalleryConfig{galleryTitle, tagCategories} = ViewerConfig galleryTitle tagCategories