aboutsummaryrefslogtreecommitdiff
path: root/compiler/src
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/src')
-rw-r--r--compiler/src/Input.hs4
-rw-r--r--compiler/src/Resource.hs12
2 files changed, 8 insertions, 8 deletions
diff --git a/compiler/src/Input.hs b/compiler/src/Input.hs
index 85c802e..95d8132 100644
--- a/compiler/src/Input.hs
+++ b/compiler/src/Input.hs
@@ -61,7 +61,7 @@ data InputTree =
61 61
62data Sidecar = Sidecar 62data Sidecar = Sidecar
63 { title :: Maybe String 63 { title :: Maybe String
64 , date :: Maybe ZonedTime 64 , datetime :: Maybe ZonedTime
65 , description :: Maybe String 65 , description :: Maybe String
66 , tags :: Maybe [String] 66 , tags :: Maybe [String]
67 } deriving (Generic, FromJSON, Show) 67 } deriving (Generic, FromJSON, Show)
@@ -69,7 +69,7 @@ data Sidecar = Sidecar
69emptySidecar :: Sidecar 69emptySidecar :: Sidecar
70emptySidecar = Sidecar 70emptySidecar = Sidecar
71 { title = Nothing 71 { title = Nothing
72 , date = Nothing 72 , datetime = Nothing
73 , description = Nothing 73 , description = Nothing
74 , tags = Nothing } 74 , tags = Nothing }
75 75
diff --git a/compiler/src/Resource.hs b/compiler/src/Resource.hs
index 53d61ac..29906b7 100644
--- a/compiler/src/Resource.hs
+++ b/compiler/src/Resource.hs
@@ -78,7 +78,7 @@ instance ToJSON GalleryItemProps where
78 78
79data GalleryItem = GalleryItem 79data GalleryItem = GalleryItem
80 { title :: String 80 { title :: String
81 , date :: ZonedTime 81 , datetime :: ZonedTime
82 , description :: String 82 , description :: String
83 , tags :: [Tag] 83 , tags :: [Tag]
84 , path :: Path 84 , path :: Path
@@ -109,7 +109,7 @@ buildGalleryTree processItem processThumbnail tagsFromDirectories galleryName in
109 fileModTime <- lastModTime path 109 fileModTime <- lastModTime path
110 return GalleryItem 110 return GalleryItem
111 { title = itemTitle 111 { title = itemTitle
112 , date = fromMaybe fileModTime $ Input.date sidecar 112 , datetime = fromMaybe fileModTime $ Input.datetime sidecar
113 , description = optMeta description "" 113 , description = optMeta description ""
114 , tags = (optMeta tags []) ++ implicitParentTags parents 114 , tags = (optMeta tags []) ++ implicitParentTags parents
115 , path = parents </ itemTitle 115 , path = parents </ itemTitle
@@ -129,7 +129,7 @@ buildGalleryTree processItem processThumbnail tagsFromDirectories galleryName in
129 dirModTime <- lastModTime path 129 dirModTime <- lastModTime path
130 return GalleryItem 130 return GalleryItem
131 { title = itemTitle 131 { title = itemTitle
132 , date = fromMaybe dirModTime $ mostRecentChildModTime processedItems 132 , datetime = fromMaybe dirModTime $ mostRecentChildModTime processedItems
133 , description = "" 133 , description = ""
134 , tags = (aggregateChildTags processedItems) ++ implicitParentTags parents 134 , tags = (aggregateChildTags processedItems) ++ implicitParentTags parents
135 , path = itemPath 135 , path = itemPath
@@ -148,10 +148,10 @@ buildGalleryTree processItem processThumbnail tagsFromDirectories galleryName in
148 148
149 mostRecentChildModTime :: [GalleryItem] -> Maybe ZonedTime 149 mostRecentChildModTime :: [GalleryItem] -> Maybe ZonedTime
150 mostRecentChildModTime = 150 mostRecentChildModTime =
151 maximumByMay comparingDates . map (date::(GalleryItem -> ZonedTime)) 151 maximumByMay comparingTime . map (datetime::(GalleryItem -> ZonedTime))
152 152
153 comparingDates :: ZonedTime -> ZonedTime -> Ordering 153 comparingTime :: ZonedTime -> ZonedTime -> Ordering
154 comparingDates l r = compare (zonedTimeToUTC l) (zonedTimeToUTC r) 154 comparingTime l r = compare (zonedTimeToUTC l) (zonedTimeToUTC r)
155 155
156 aggregateChildTags :: [GalleryItem] -> [Tag] 156 aggregateChildTags :: [GalleryItem] -> [Tag]
157 aggregateChildTags = unique . concatMap (\item -> tags (item::GalleryItem)) 157 aggregateChildTags = unique . concatMap (\item -> tags (item::GalleryItem))