summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJasper Van der Jeugt <jaspervdj@gmail.com>2010-01-18 19:30:43 +0100
committerJasper Van der Jeugt <jaspervdj@gmail.com>2010-01-18 19:30:43 +0100
commit06408148eef18707c32cad4d06e293c65962fe5c (patch)
tree9852933ccb577e00f28cd681486c44561bc93eec /src
parent673ed68b8fd41c9420d353e6efd11d5405e53360 (diff)
parente01531bd7593b871d8fb18c5ea509394eb8785ba (diff)
downloadhakyll-06408148eef18707c32cad4d06e293c65962fe5c.tar.gz
Merge branch 'master' of git://github.com/seschwar/Hakyll into experimental
Conflicts: hakyll.cabal src/Text/Hakyll/Page.hs src/Text/Hakyll/Render/Internal.hs
Diffstat (limited to 'src')
-rw-r--r--src/Text/Hakyll/File.hs12
-rw-r--r--src/Text/Hakyll/Page.hs9
2 files changed, 15 insertions, 6 deletions
diff --git a/src/Text/Hakyll/File.hs b/src/Text/Hakyll/File.hs
index 393c4a8..2a77707 100644
--- a/src/Text/Hakyll/File.hs
+++ b/src/Text/Hakyll/File.hs
@@ -42,7 +42,17 @@ toCache path = "_cache" </> (removeLeadingSeparator path)
-- | Get the url for a given page.
toURL :: FilePath -> FilePath
-toURL path = if takeExtension path `elem` [".markdown", ".md", ".tex"]
+toURL path = if takeExtension path `elem` [ ".markdown"
+ , ".md"
+ , ".mdn"
+ , ".mdwn"
+ , ".mkd"
+ , ".mkdn"
+ , ".mkdwn"
+ , ".rst"
+ , ".text"
+ , ".tex"
+ ]
then flip addExtension ".html" $ dropExtension path
else path
diff --git a/src/Text/Hakyll/Page.hs b/src/Text/Hakyll/Page.hs
index bd15ad1..bae7fa6 100644
--- a/src/Text/Hakyll/Page.hs
+++ b/src/Text/Hakyll/Page.hs
@@ -61,10 +61,9 @@ renderFunction ".html" = id
renderFunction ext = writeHtmlString writerOptions
. readFunction ext defaultParserState
where
- readFunction ".markdown" = readMarkdown
- readFunction ".md" = readMarkdown
- readFunction ".tex" = readLaTeX
- readFunction _ = readMarkdown
+ readFunction ".rst" = readRST
+ readFunction ".tex" = readLaTeX
+ readFunction _ = readMarkdown
-- | Read metadata header from a file handle.
readMetaData :: Handle -> Hakyll [(String, String)]
@@ -134,7 +133,7 @@ readPage pagePath = do
, ("path", pagePath)
] ++ metaData
- seq (($|) id rdeepseq rendered) $ liftIO $ hClose handle
+ seq (($|) id rdeepseq rendered) $ hClose handle
-- Cache if needed
if getFromCache then return () else cachePage page