Updating Hakyll posts

Posted on October 2, 2012
Tags: hacksoft

0.0.1 How does Hakyll site.hs work?

    match "images/*" $ do
        route   idRoute
        compile copyFileCompiler

3 main functions: match route compile

match "images/*" images/dog.png will be matched

route idRoute
route basically transforms the filename
In this case idRoute is the identity function meaning no change to the name “dog.png”

compile copyFileCompiler we copy “/images/dog.png” to the same path meaning no change.

0.0.2 Updating hakyll posts

chcp 65001
stack exec myblog clean
stack exec myblog build

view the site by going to your ~/myblog/docs/index.html

git add .
git commit -m "some message"
git push origin main:main

Hot reload

stack exec myblog watch

0.0.3 Updating Hakyll site.hs

if you messed around in site.hs , you need to do

stack build
stack exec myblog rebuild

0.0.4 Pandoc formatting

Example codeblock uses 3 backquotes then name of language
we can also do {.haskell .numberLines} to have a numbered codeblock

--```haskell
--  fac n = foldr (*) 1 [1..n]
--```

--``` {.haskell .numberLines}
--fac n = foldr (*) 1 [1..n]
--```
fac n = foldr (*) 1 [1..n]

Inline code print(stuff) uses

`print(stuff)`{.python}

For Latex

$$ bleh \in Set  $$

\[ bleh \in Set \]