aboutsummaryrefslogtreecommitdiff
path: root/compiler/src/Input.hs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/src/Input.hs')
-rw-r--r--compiler/src/Input.hs12
1 files changed, 7 insertions, 5 deletions
diff --git a/compiler/src/Input.hs b/compiler/src/Input.hs
index 681f169..64c1933 100644
--- a/compiler/src/Input.hs
+++ b/compiler/src/Input.hs
@@ -1,5 +1,3 @@
1{-# LANGUAGE DuplicateRecordFields, DeriveGeneric, DeriveAnyClass #-}
2
3-- ldgallery - A static generator which turns a collection of tagged 1-- ldgallery - A static generator which turns a collection of tagged
4-- pictures into a searchable web gallery. 2-- pictures into a searchable web gallery.
5-- 3--
@@ -18,6 +16,11 @@
18-- You should have received a copy of the GNU Affero General Public License 16-- You should have received a copy of the GNU Affero General Public License
19-- along with this program. If not, see <https://www.gnu.org/licenses/>. 17-- along with this program. If not, see <https://www.gnu.org/licenses/>.
20 18
19{-# LANGUAGE
20 DuplicateRecordFields
21 , DeriveGeneric
22 , DeriveAnyClass
23#-}
21 24
22module Input 25module Input
23 ( decodeYamlFile 26 ( decodeYamlFile
@@ -55,7 +58,7 @@ data InputTree =
55 , sidecar :: Sidecar } 58 , sidecar :: Sidecar }
56 | InputDir 59 | InputDir
57 { path :: Path 60 { path :: Path
58 , thumbnailPath :: Maybe Path 61 , dirThumbnailPath :: Maybe Path
59 , items :: [InputTree] } 62 , items :: [InputTree] }
60 deriving Show 63 deriving Show
61 64
@@ -68,8 +71,7 @@ data Sidecar = Sidecar
68 71
69 72
70readInputTree :: AnchoredFSNode -> IO InputTree 73readInputTree :: AnchoredFSNode -> IO InputTree
71readInputTree (AnchoredFSNode anchor root@Dir{}) = 74readInputTree (AnchoredFSNode anchor root@Dir{}) = mkDirNode root
72 filterDir (not . isHidden) root & mkDirNode
73 where 75 where
74 mkInputNode :: FSNode -> IO (Maybe InputTree) 76 mkInputNode :: FSNode -> IO (Maybe InputTree)
75 mkInputNode (File path@(filename:pathto)) | ".yaml" `isExtensionOf` filename = 77 mkInputNode (File path@(filename:pathto)) | ".yaml" `isExtensionOf` filename =