Setup Link to heading
This repo is organised with two branches: the main branch contains code needed to build the final site which resides in the gh-pages branch, following instructions from here:
┌──────────────┐ ┌──────────────────┐
│ branch: main │ ┌►│ branch: gh-pages │
├──────────────┤ │ ├──────────────────┤
│ ./content │ │ │ ./index.html │
│ ... │ │ │ ./sitemap.xmp │
│ ./public ────┼──┘ │ ... │
└──────────────┘ └──────────────────┘
In the GitHub repo settings, under “Page”, you have to set the branch from which the site is being built, in my case: gh-pages
.
For site generation, I am using hugo with the hugo-coder theme.
Instead of dealing with Go and hugo installation locally, I use a docker image which provides hugo
and allows me to serve
and build
and the blog. This is defined in the Justfile:
set positional-arguments
image := "hugomods/hugo:0.131.0"
@run *args:
docker run --rm -t \
-u $(id -u):$(id -g) \
-v `pwd`:/src \
-p 1313:1313 \
{{image}} \
$@
serve:
just run hugo server --bind 0.0.0.0
build:
just run hugo
push:
(cd public/ \
&& git add . \
&& git commit -m "[$(date +'%Y-%m-%dT%H:%M:%S%:z')] rebuild site" \
&& git push -u origin gh-pages)
When I’m ready to push the built site to the gh-pages
branch, I just use the push
rule.
Example Link to heading
This section tests various writing features of the blog’s theme.
Markdown Link to heading
This is a quote block
:
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam dolor neque, egestas ut porta in, lacinia ac nibh. Nulla vehicula vehicula massa in ultricies. Aliquam rhoncus luctus tincidunt. Aliquam facilisis nibh erat, eget tincidunt risus vehicula a. Duis lacinia velit vel leo lacinia, nec dignissim augue accumsan. Donec aliquam fermentum suscipit. Quisque imperdiet urna ligula, ut vulputate augue rhoncus id. Integer sed arcu maximus, faucibus mauris blandit, imperdiet est.
To do Link to heading
- check this
- find nice content to add
- add citations
Maths Link to heading
- Here’s Euler’s identity in
inline-mode
: $e^{i \pi} + 1 = 0$. - Here’s Gaussian integral in
display-mode
:
$$ \int_{0}^{\infty} e^{-x^2} \mathrm{d}x = \dfrac{\sqrt{\pi}}{2} $$
Code Link to heading
Here’s some Python code:
class Foo:
def __init__(self, *args, **kwargs):
pass
if __name__ == "__main__":
xs = [1, 2, 3]
ys = map(lambda x: x + 1, xs)
zs = sum(ys)
and some Haskell:
fib :: Num a => [a]
fib = 1:1:zipWith (+) fib (tail fib)
take 10 fib
-- [1,1,2,3,5,8,13,21,34,55]