Reference:
Hakyll. And it’s using
Pandoc library that
can convert documents between different formats.
Install
1 | # Create the skeleton website |
Code Highlighting
Change the CSS/defaut to use pre-generated CSS from Pandoc to do syntax highlighting:
1 | code { |
Math
Mostly followed this
blog post.
Write the site.hs
file at the import module block:
1 | import qualified Data.Set as S |
here it’s needed to tell the pages-hakyll.cabal
that we added depends
1 | executable site |
Creat the compiler pandocMathCompiler
1 | pandocMathCompiler = |
Add the Mathjax in the template default.html
:
1 | <script type="text/javascript" |
Math test:
$E = mc^2$
$$\Delta_A(\lambda)=\det(\lambda I-A)$$
\begin{aligned}
\dot{x} & = \sigma(y-x) \\
\dot{y} & = -\beta z + xy
\end{aligned}
Add tags
This blog shows the steps.
Change the site.hs
1 | -- build up tags |
also need to change template/post.html
and create a tag page template/tag.html
.