Huy's Notes
How I built this notebook

How I built this notebook

You may notice that this site is heavily inspired by Andy Matuschak's notes, if the navigation confused you, you should take a look at [How to navigate this notebook] first.

This site is powered by [Gatsby], the theme in use is gatsby-theme-andy.

All the notes are written in markdown format using Emacs, I know what you're thinking, I don't use org-mode on this notebook for some reason, you can read more about how I use [Emacs for note-taking].

The Gastby theme I'm using does not support listing all available note, and it hurts discoverability, so I wrote an indexing script get the list of all markdown files, sort them by last modification date and list them all into an index file.

At first, I tried to write the indexing script in bash, it's such a pain, so I use JavaScript to get the job done, something like this:

const sorted_files = files.filter(f => f.endsWith(".md") && !f.startsWith(""))
  .map(filename => {
  return {
    name: filename,
    modified: fs.statSync(dir + filename).mtime.getTime()
.sort((a, b) => b.modified - a.modified)
.map(f => `- [file:${".md", "")}]`)

Finally, Gatsby build script will kick in and generate everything into static HTML files, and push them to Github Pages.

Referred in

If you think this note resonated, be it positive or negative, please feel free to send me an email and we can talk.