This commit is contained in:
Yann Esposito (Yogsototh) 2020-06-22 12:27:45 +02:00
parent b81339a51e
commit 5359765bf5
Signed by untrusted user who does not match committer: yogsototh
GPG Key ID: 7B19A4C650D59646
3 changed files with 22 additions and 15 deletions

2
.gitignore vendored
View File

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

View File

@ -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

View File

@ -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