john melesky 8 жил өмнө
parent
commit
038d63e84c
1 өөрчлөгдсөн 2 нэмэгдсэн , 4 устгасан
  1. 2 4
      site.hs

+ 2 - 4
site.hs

@@ -52,7 +52,7 @@ main = hakyll $ do
   create ["archive.html"] $ do
     route idRoute
     compile $ do
-      posts <- recentFirst =<< loadAll "posts/*"
+      posts <- recentFirst =<< loadAll "posts/*.md"
       let archiveCtx =
             listField "posts" postCtx (return posts) `mappend`
             constField "title" "Archives"            `mappend`
@@ -67,9 +67,7 @@ main = hakyll $ do
   create ["new_index.html"] $ do
     route idRoute
     compile $ do
-      posts <- recentFirst =<< loadAll "posts/*"
-      let post =
-            head (return posts)
+      post <- fmap (head) recentFirst =<< loadAll "posts/*.md"
       pandocCompiler
         >>= loadAndApplyTemplate "templates/post.html"    (postCtxWithTags tags)
         >>= loadAndApplyTemplate "templates/default.html" (postCtxWithTags tags)