Posted on :: Tags: , , ,

I've kept on telling my people that researchers should have a way to constantly write out what they think and learn, even though things may turn out to be wrong at some point. I posted this (from Nathan Pyle's comic, "Strange Planet") on my door to remind me of the importance of conveying ideas with evidence. I also believe that paper writing starts at the beginning of any project with a small step at a time. Idea conception, writing a paper, and doing research.

Although I keep my markdown notes and scanned copies of scribbles, I have been searching for a quick and easy way to keep my ideas. First of all, I was fed up enough with R's bookdown and Hugo setup. It was more complex than I would ever need. I have some experience with old web programming, but Hugo was too hard for me. After searching and searching, I found Zola was simple enough, command line friendly, and editor friendly. It also took me some time to figure out, though.

First, install zola locally. More details on installation can be found: https://www.getzola.org/documentation/getting-started/installation/ and some web search.

Then, we can set up a new zola directory:

zola init ${BLOG}

Here, ${BLOG} can be any working directory.

I was too lazy to tweak HTML pages and styles, so I decide to use Apollo theme.

git submodule add https://github.com/not-matthias/apollo themes/apollo

or simply clone:

git clone https://github.com/not-matthias/apollo themes/apollo

Out of the box, things work fine, but it's worth customizing config.toml:

theme = "apollo"
taxonomies = [{ name = "tags" }]

# The URL the site will be built for
base_url = "CHANGE ME"

# Whether to automatically compile all Sass files in the sass directory
compile_sass = true

# Whether to build a search index to be used later on by a JavaScript library
build_search_index = true

output_dir = "CHANGE ME"

generate_feeds = true

[markdown]
# Whether to do syntax highlighting
# Theme can be customised by setting the `highlight_theme` variable to a theme supported by Zola
highlight_code = true
highlight_theme = "ayu-light"

[extra]
# See this for more options: https://github.com/not-matthias/apollo/blob/main/config.toml#L14
toc = true
use_cdn = false
theme = "toggle"

socials = [
]
menu = [
]

mathjax = true
mathjax_dollar_inline_enable = true
fancy_code = true
insert_anchor_links = "heading"
favicon = "/icon/favicon.ico"

Finally, we can create _index.md as a front page:

emacs content/_index.md

_index.md could be something like this:

+++
title= "my blog"
template = "homepage.html"
+++

Welcome to my blog

We can ask zola to generate HTML and js pages:

zola build

A new site will be located under where the output_dir is pointing to. We can simply push the entire directory to GitHub or a similar kind.

Every time we need to update, we can create a new 'md' file under 'content' where different. To have a handle to a new set of posts, we need to add a new menu item in config.toml:

menu = [
    { name = "/posts", url = "/posts", weight = 1 },
]

In content/posts/, we can add _index.md to help navigate posts:

+++
paginate_by = 7
title = "Posts"
sort_by = "date"

insert_anchor_links = "heading"
+++

Happy blogging!