@@ -8,7 +8,7 @@ module Hakyll.Web.Pandoc.FileType
88
99
1010--------------------------------------------------------------------------------
11−import System.FilePath (takeExtension)
11+import System.FilePath (splitExtension)
1212
1313
1414--------------------------------------------------------------------------------
@@ -36,12 +36,16 @@ data FileType
3636--------------------------------------------------------------------------------
3737-- | Get the file type for a certain file. The type is determined by extension.
3838fileType :: FilePath -> FileType
39−fileType = uncurry fileType' . splitExtension
39+fileType = uncurry fileType' . splitExtension
4040 where
4141 fileType' _ ".css" = Css
4242 fileType' _ ".htm" = Html
4343 fileType' _ ".html" = Html
44− fileType' f ".lhs" = LiterateHaskell (fileType' (takeExtension f))
44+ fileType' f ".lhs" = LiterateHaskell $ case fileType f of
45+ -- If no extension is given, default to Markdown + LiterateHaskell
46+ Binary -> Markdown
47+ -- Otherwise, LaTeX + LiterateHaskell or whatever the user specified
48+ x -> x
4549 fileType' _ ".markdown" = Markdown
4650 fileType' _ ".md" = Markdown
4751 fileType' _ ".mdn" = Markdown