on master help sign in
Added support for other common Markdown file extensions.
commit47fae0ed2a075d6e685963c1ce411fe28d1fcfd5 authorSebastian Schwarz <seschwar@googlemail.com> dateMon 18 Jan 2010, 17:51 (17 years ago) parent20bde6c
2 files changed+12−5
src/Text/Hakyll/File.hs+10−1 src/Text/Hakyll/Page.hs+2−4
src/Text/Hakyll/File.hs+10−1
@@ -39,7 +39,16 @@ toCache path = "_cache" </> (removeLeadingSeparator path)
3939
4040-- | Get the url for a given page.
4141toURL :: FilePath -> FilePath
42−toURL path = if takeExtension path `elem` [".markdown", ".md", ".tex"]
42+toURL path = if takeExtension path `elem` [ ".markdown"
43+ , ".md"
44+ , ".mdn"
45+ , ".mdwn"
46+ , ".mkd"
47+ , ".mkdn"
48+ , ".mkdwn"
49+ , ".text"
50+ , ".tex"
51+ ]
4352 then flip addExtension ".html" $ dropExtension path
4453 else path
4554
src/Text/Hakyll/Page.hs+2−4
@@ -60,10 +60,8 @@ renderFunction ".html" = id
6060renderFunction ext = writeHtmlString writerOptions
6161 . readFunction ext defaultParserState
6262 where
63− readFunction ".markdown" = readMarkdown
64− readFunction ".md" = readMarkdown
65− readFunction ".tex" = readLaTeX
66− readFunction _ = readMarkdown
63+ readFunction ".tex" = readLaTeX
64+ readFunction _ = readMarkdown
6765
6866-- | Read metadata header from a file handle.
6967readMetaData :: Handle -> IO [(String, String)]