@@ -140,7 +140,7 @@ writeEPUB version opts doc@(Pandoc meta _) = do
140 let chapToEntry :: Int -> [Tag String] -> Entry
140 let chapToEntry :: Int -> [Tag String] -> Entry
141 chapToEntry num ts = mkEntry (showChapter num)
141 chapToEntry num ts = mkEntry (showChapter num)
142 $ fromStringLazy
142 $ fromStringLazy
143− $ renderTemplate [("body",renderTags ts)]
143+ $ renderTemplate [("body",renderTags ts), ("pagetitle",show num)]
144 $ pageTemplate
144 $ pageTemplate
146 let chapterEntries = zipWith chapToEntry [1..] chunks
146 let chapterEntries = zipWith chapToEntry [1..] chunks
@@ -173,8 +173,9 @@ writeEPUB version opts doc@(Pandoc meta _) = do
173 Pandoc meta [Plain t]
173 Pandoc meta [Plain t]
174 let plainTitle = plainify $ docTitle meta
174 let plainTitle = plainify $ docTitle meta
175 let plainAuthors = map plainify $ docAuthors meta
175 let plainAuthors = map plainify $ docAuthors meta
176− let plainDate = maybe "" id $ normalizeDate $ stringify $ docDate meta
177 currentTime <- getCurrentTime
176 currentTime <- getCurrentTime
177+ let plainDate = maybe (showDateTimeISO8601 currentTime) id
178+ $ normalizeDate $ stringify $ docDate meta
178 let contentsData = fromStringLazy $ ppTopElement $
179 let contentsData = fromStringLazy $ ppTopElement $
179 unode "package" ! [("version", case version of
180 unode "package" ! [("version", case version of
180 EPUB2 -> "2.0"
181 EPUB2 -> "2.0"