Procházet zdrojové kódy

fumbling with hakyll

john melesky před 8 roky
rodič
revize
038d63e84c
1 změnil soubory, kde provedl 2 přidání a 4 odebrání
  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)