Browse Source

updated

shake
parent
commit
5359765bf5
Signed by: yogsototh GPG Key ID: 7B19A4C650D59646
  1. 2
      .gitignore
  2. 22
      Shakefile.hs
  3. 13
      _site/index.html

2
.gitignore

@ -1,4 +1,6 @@
_cache/
_site/
_optim/
src/archive.org
.direnv/
_shake/

22
Shakefile.hs

@ -80,25 +80,43 @@ sortByPostDate :: [BlogPost] -> [BlogPost]
sortByPostDate =
sortBy (\b a -> compare (Down (postDate a)) (Down (postDate b)))
build = (</>) siteDir
buildRules :: Rules ()
buildRules = do
let build = (</>) siteDir
cleanRule
allRule
getPost <- mkGetPost
getPosts <- mkGetPosts getPost
let cssDeps = map (siteDir </>) <$> getDirectoryFiles "" ["src/css/*.css"]
build "index.html" %> \out -> do
build "articles.html" %> \out -> do
css <- cssDeps
posts <- getPosts ()
need $ css <> map postUrl (sortByPostDate posts)
let titles = T.unpack $ T.intercalate "\n" $ map postTitle posts
writeFile' out titles
build "index.html" %> \out -> do
css <- cssDeps
need $ css <> ["src/index.org"]
bp <- getPost "src/index.org"
eitherHtml <- liftIO $ Pandoc.runIO $ Writers.writeHtml5String def (postBody bp)
case eitherHtml of
Left _ -> fail "BAD"
Right htmlFile -> writeFile' out (T.unpack htmlFile)
-- build "//*.html" %> \out -> do
-- css <- cssDeps
-- let orgfile = dropDirectory1 out
-- post <- getPost orgfile
build "src/css/*.css" %> \out -> copyFile' (dropDirectory1 out) out
allRule :: Rules ()
allRule =
phony "all" $
need (map build [ "index.html"
, "articles.html"])
cleanRule :: Rules ()
cleanRule =
phony "clean" $ do

13
_site/index.html

@ -1,13 +0,0 @@
New Blog
Troll 2
Autoload Script by project
How I Internet
RSS Generation
Modern IRC
Catalina iTerm Theme switch
Further Blog Engine change
Optimize the size of no js websites
Learn Haskell Now!
Add links to code block during orgmode export
Solaryzed: A Generalisation of Solarized
How to choose your tools
Loading…
Cancel
Save