This commit is contained in:
Yann Esposito (Yogsototh) 2020-06-25 07:06:16 +02:00
parent 0a1aef7425
commit c34fa83504
Signed by untrusted user who does not match committer: yogsototh
GPG Key ID: 7B19A4C650D59646
4 changed files with 11 additions and 10 deletions

View File

@ -107,12 +107,11 @@ genAllDeps patterns = do
buildRules :: Rules ()
buildRules = do
cleanRule
-- build "//*" %> copy
allRule
getPost <- mkGetPost
getPosts <- mkGetPosts getPost
getTemplate <- mkGetTemplate
build "//*" %> \out -> do
build "**" %> \out -> do
let asset = dropDirectory1 out
case (takeExtension asset) of
".html" -> do
@ -231,13 +230,13 @@ genAsciiAction getPost out = do
allHtmlAction :: Action ()
allHtmlAction = do
allOrgFiles <- getDirectoryFiles srcDir ["//*.org"]
allOrgFiles <- getDirectoryFiles srcDir ["**.org"]
let allHtmlFiles = map (-<.> "html") allOrgFiles
need (map build allHtmlFiles)
allAsciiAction :: Action ()
allAsciiAction = do
allOrgFiles <- getDirectoryFiles srcDir ["//*.org"]
allOrgFiles <- getDirectoryFiles srcDir ["**.org"]
let allAsciiFiles = map (-<.> "txt") allOrgFiles
need (map build allAsciiFiles)
@ -263,7 +262,7 @@ compressImage img = do
allRule :: Rules ()
allRule =
phony "all" $ do
allAssets <- filter (/= ".DS_Store") <$> getDirectoryFiles srcDir ["//*.*"]
allAssets <- filter (/= ".DS_Store") <$> getDirectoryFiles srcDir ["**"]
need (map build $ allAssets <> ["archive.html"])
allHtmlAction
allAsciiAction
@ -272,7 +271,7 @@ cleanRule :: Rules ()
cleanRule =
phony "clean" $ do
putInfo "Cleaning files in _site and _optim"
forM_ [siteDir,optimDir] $ flip removeFilesAfter ["//*"]
forM_ [siteDir,optimDir] $ flip removeFilesAfter ["**"]
mkGetTemplate :: Rules (FilePath -> Action Template)
mkGetTemplate = newCache $ \path -> do
@ -302,4 +301,4 @@ mkGetPost = newCache $ \path -> do
mkGetPosts :: (FilePath -> Action b) -> Rules (() -> Action [b])
mkGetPosts getPost =
newCache $ \() -> mapM getPost =<< getDirectoryFiles "" ["src/posts//*.org"]
newCache $ \() -> mapM getPost =<< getDirectoryFiles "" ["src/posts/**.org"]

View File

@ -26,5 +26,7 @@ pkgs.mkShell {
git
direnv
haskellPackages.shake
# for emacs dev
ripgrep
];
}

View File

@ -344,9 +344,9 @@ After the rule.
an image:
#+ATTR_HTML: The Experiment
#+CAPTION: Testing include an image
#+NAME: fig:test-image
#+ATTR_HTML: The Experiment
[[../img/a.png]]

View File

@ -19,8 +19,8 @@ And this week-end, in the morning I read those:
- [[https://news.ycombinator.com/item?id=23107123][Making Emacs popular again]]
- [[https://news.ycombinator.com/item?id=23092904][Github Codespace]]
#+DOWNLOADED: https://external-content.duckduckgo.com/iu/?u=https%3A%2F%2Ftse1.mm.bing.net%2Fth%3Fid%3DOIP.g7OSuCGH0u7OIUA9vdxlTAEsCo%26pid%3DApi&f=1 @ 2020-05-09 12:49:34
#+ATTR_HTML: :alt Midsommar Welcome
#+DOWNLOADED: https://external-content.duckduckgo.com/iu/?u=https%3A%2F%2Ftse1.mm.bing.net%2Fth%3Fid%3DOIP.g7OSuCGH0u7OIUA9vdxlTAEsCo%26pid%3DApi&f=1 @ 2020-05-09 12:49:34
[[file:2020-05-09_12-49-34_.jpeg]]
@ -93,8 +93,8 @@ For the single developers and open source developers this offer:
But the price to pay is hidden.
#+DOWNLOADED: https://external-content.duckduckgo.com/iu/?u=https%3A%2F%2Ftse1.mm.bing.net%2Fth%3Fid%3DOIP.FrCRrhENMjdfD4pUcAwKEgHaEK%26pid%3DApi&f=1 @ 2020-05-09 12:48:31
#+ATTR_HTML: :alt Midsommar Cry
#+DOWNLOADED: https://external-content.duckduckgo.com/iu/?u=https%3A%2F%2Ftse1.mm.bing.net%2Fth%3Fid%3DOIP.FrCRrhENMjdfD4pUcAwKEgHaEK%26pid%3DApi&f=1 @ 2020-05-09 12:48:31
[[file:2020-05-09_12-48-31_.jpeg]]