muon 0.1.0.6 → 0.1.0.7
raw patch · 3 files changed
+13/−11 lines, 3 filesdep +HTTP
Dependencies added: HTTP
Files
- README.md +3/−3
- muon.cabal +5/−5
- src/Post.hs +5/−3
README.md view
@@ -91,12 +91,12 @@ right name in the "pages/" directory of your blog. For example, if your blog is at "myblog.com" and you want a page at-"myblog.com/mypage", edit the file "pages/mypage.html" and fill it with+"myblog.com/mypage", edit the file "pages/mypage" and fill it with HTML. Bear in mind, this content will go in between the "header" and-"footer" templates, so you don't need to include <body> or <html> tags.+"footer" templates, so you don't need to include \<body\> or \<html\> tags. Here's how you might do that: - $ cat >> pages/mypage.html <<EOF+ $ cat >> pages/mypage <<EOF <h2>My Custom Page</h2> <p>This is a page I made!</p> EOF
muon.cabal view
@@ -1,5 +1,5 @@ name: muon-version: 0.1.0.6+version: 0.1.0.7 synopsis: Static blog generator description: Program which takes blog posts and pages written in Markdown and@@ -14,11 +14,11 @@ . * Uploading a site to a server using rsync .-homepage: https://code.kaashif.co.uk/kaashif/muon+homepage: http://github.com/kaashif-hymabaccus/muon license: BSD3 license-file: LICENSE author: Kaashif Hymabaccus-maintainer: kaashifhymabaccus@gmail.com+maintainer: kaashif@kaashif.co.uk copyright: Copyright (c) 2014 Kaashif Hymabaccus category: Web build-type: Simple@@ -34,9 +34,9 @@ source-repository head type: git- location: https://code.kaashif.co.uk/kaashif/muon.git+ location: http://github.com/kaashif-hymabaccus/muon.git executable muon main-is: Main.hs- build-depends: base ==4.6.*, text ==0.11.*, HStringTemplate ==0.7.*, directory ==1.2.*, Glob ==0.7.*, process ==1.2.*, blaze-html ==0.7.*, markdown ==0.1.*, ConfigFile==1.1.*, MissingH==1.2.*, happstack-server==7.3.*+ build-depends: base ==4.6.*, text ==0.11.*, HStringTemplate ==0.7.*, directory ==1.2.*, Glob ==0.7.*, process ==1.2.*, blaze-html ==0.7.*, markdown ==0.1.*, ConfigFile==1.1.*, MissingH==1.2.*, happstack-server==7.3.*, HTTP ==4000.2.* hs-source-dirs: src
src/Post.hs view
@@ -4,6 +4,7 @@ import qualified Data.Text as T import qualified Data.Text.Lazy as TL+import qualified Data.String.Utils as S import Text.StringTemplate import Text.StringTemplate.GenericStandard import Text.Blaze.Html.Renderer.Text@@ -14,10 +15,10 @@ import Data.Data import Data.List import Data.Char-import qualified Data.String.Utils as S import Site import Control.Monad import Constant+import Network.HTTP.Base (urlEncode) postPath = "posts/" :: String @@ -65,7 +66,6 @@ extractContent :: [String] -> String extractContent l = TL.unpack- $ TL.replace "<pre>" "<pre class=\'prettyprint\'>" $ renderHtml $ markdown def $ TL.pack@@ -83,7 +83,9 @@ return $ (sort . head . fst) d linkify :: [Char] -> [Char]-linkify s = filter isLetter $ map toLower $ S.replace " " "-" s+linkify s = filter (\x -> isAlphaNum x || x=='-')+ $ map toLower+ $ S.replace " " "-" s writePosts :: [Post] -> IO () writePosts ps = mapM_ writePost ps