summaryrefslogtreecommitdiff
path: root/src/Hakyll/Web/Pandoc/FileType.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Hakyll/Web/Pandoc/FileType.hs')
-rw-r--r--src/Hakyll/Web/Pandoc/FileType.hs40
1 files changed, 20 insertions, 20 deletions
diff --git a/src/Hakyll/Web/Pandoc/FileType.hs b/src/Hakyll/Web/Pandoc/FileType.hs
index 1ae4c10..28698a7 100644
--- a/src/Hakyll/Web/Pandoc/FileType.hs
+++ b/src/Hakyll/Web/Pandoc/FileType.hs
@@ -36,27 +36,27 @@ data FileType
--------------------------------------------------------------------------------
-- | Get the file type for a certain file. The type is determined by extension.
fileType :: FilePath -> FileType
-fileType = fileType' . takeExtension
+fileType = uncurry fileType' . splitExtension
where
- fileType' ".css" = Css
- fileType' ".htm" = Html
- fileType' ".html" = Html
- fileType' ".lhs" = LiterateHaskell Markdown
- fileType' ".markdown" = Markdown
- fileType' ".md" = Markdown
- fileType' ".mdn" = Markdown
- fileType' ".mdown" = Markdown
- fileType' ".mdwn" = Markdown
- fileType' ".mkd" = Markdown
- fileType' ".mkdwn" = Markdown
- fileType' ".org" = OrgMode
- fileType' ".page" = Markdown
- fileType' ".rst" = Rst
- fileType' ".tex" = LaTeX
- fileType' ".text" = PlainText
- fileType' ".textile" = Textile
- fileType' ".txt" = PlainText
- fileType' _ = Binary -- Treat unknown files as binary
+ fileType' _ ".css" = Css
+ fileType' _ ".htm" = Html
+ fileType' _ ".html" = Html
+ fileType' f ".lhs" = LiterateHaskell (fileType' (takeExtension f))
+ fileType' _ ".markdown" = Markdown
+ fileType' _ ".md" = Markdown
+ fileType' _ ".mdn" = Markdown
+ fileType' _ ".mdown" = Markdown
+ fileType' _ ".mdwn" = Markdown
+ fileType' _ ".mkd" = Markdown
+ fileType' _ ".mkdwn" = Markdown
+ fileType' _ ".org" = OrgMode
+ fileType' _ ".page" = Markdown
+ fileType' _ ".rst" = Rst
+ fileType' _ ".tex" = LaTeX
+ fileType' _ ".text" = PlainText
+ fileType' _ ".textile" = Textile
+ fileType' _ ".txt" = PlainText
+ fileType' _ _ = Binary -- Treat unknown files as binary
--------------------------------------------------------------------------------