diff options
author | pacien | 2020-02-25 19:25:16 +0100 |
---|---|---|
committer | Notkea | 2020-02-27 19:33:49 +0100 |
commit | b468dcbf3343ea251703078ec89d3215116fc2f6 (patch) | |
tree | 3bf1a18762a399a2a98a81c14332a8dd244ad0ad | |
parent | 27a7bebc32a527cc86857008b491b9571e807183 (diff) | |
download | ldgallery-b468dcbf3343ea251703078ec89d3215116fc2f6.tar.gz |
compiler: re-introduce gallery title
-rw-r--r-- | compiler/ldgallery.1.md | 3 | ||||
-rw-r--r-- | compiler/src/Config.hs | 9 | ||||
-rw-r--r-- | example/src/gallery.yaml | 2 | ||||
-rw-r--r-- | viewer/src/@types/gallery.d.ts | 2 |
4 files changed, 12 insertions, 4 deletions
diff --git a/compiler/ldgallery.1.md b/compiler/ldgallery.1.md index 4c9c6c8..3e20562 100644 --- a/compiler/ldgallery.1.md +++ b/compiler/ldgallery.1.md | |||
@@ -115,6 +115,9 @@ tags | |||
115 | 115 | ||
116 | The gallery settings reside in a file named "gallery.yaml" located at the root of the gallery's source directory. | 116 | The gallery settings reside in a file named "gallery.yaml" located at the root of the gallery's source directory. |
117 | 117 | ||
118 | galleryTitle | ||
119 | : Title of the gallery. Defaults to "ldgallery". | ||
120 | |||
118 | includedDirectories[] | 121 | includedDirectories[] |
119 | : Glob patterns of directory names to include in the gallery. Defaults to ["*"] (matches all directory names). | 122 | : Glob patterns of directory names to include in the gallery. Defaults to ["*"] (matches all directory names). |
120 | 123 | ||
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 | ||
52 | data GalleryConfig = GalleryConfig | 52 | data 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 | ||
62 | instance FromJSON GalleryConfig where | 63 | instance 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 | ||
76 | data ViewerConfig = ViewerConfig | 78 | data 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 | ||
80 | viewerConfig :: GalleryConfig -> ViewerConfig | 83 | viewerConfig :: GalleryConfig -> ViewerConfig |
81 | viewerConfig _ = ViewerConfig -- TODO | 84 | viewerConfig GalleryConfig{galleryTitle} = ViewerConfig galleryTitle |
diff --git a/example/src/gallery.yaml b/example/src/gallery.yaml index b25b657..d2f90aa 100644 --- a/example/src/gallery.yaml +++ b/example/src/gallery.yaml | |||
@@ -1,5 +1,7 @@ | |||
1 | # ldgallery example gallery configuration file | 1 | # ldgallery example gallery configuration file |
2 | 2 | ||
3 | #galleryTitle: "ldgallery" | ||
4 | |||
3 | #includedDirectories: ["*"] | 5 | #includedDirectories: ["*"] |
4 | #excludedDirectories: [] | 6 | #excludedDirectories: [] |
5 | 7 | ||
diff --git a/viewer/src/@types/gallery.d.ts b/viewer/src/@types/gallery.d.ts index 399fb66..4fa544f 100644 --- a/viewer/src/@types/gallery.d.ts +++ b/viewer/src/@types/gallery.d.ts | |||
@@ -23,7 +23,7 @@ declare namespace Gallery { | |||
23 | } | 23 | } |
24 | 24 | ||
25 | interface GalleryProperties { | 25 | interface GalleryProperties { |
26 | // empty for now | 26 | galleryTitle: string |
27 | } | 27 | } |
28 | interface Index { | 28 | interface Index { |
29 | properties: GalleryProperties, | 29 | properties: GalleryProperties, |