kumar~

Code Journal

A statically-generated site for showcasing and organizing my coding notes, with personalized formatting and syntax highlighting for better readability and structure

Tech-stack:

  • Astro logo Astro
  • TypeScript logo TypeScript
  • CSS logo CSS

Background

I tried out many note-taking solutions such Notion, Obsidian as well as just hosting plain markdown files on Github Pages. They had various features that worked for some cases, but i wanted a more custom layout and styling aimed especially at displaying code snippets and other specialized content. This meant i was particularly looking for features like syntax-highlighting, nicer themes (for the code snippets as well as the whole site), diagrams, math expressions etc. I had heard great things about Astro on the internet, most saying how great it is for static-content focussed sites; so I felt this could be an exciting new side-project. Writing notes that are publicly would also make me likely to put more effort into their content

Features

  • Statically-built site with very minimal javascript overhead, making it fast and light-weight
  • Each markdown document’s frontmatter is type-validated against a schema with the help of Typescript and Zod
  • Light and Dark theme slider, that automatically sets based on your system and site preferences
  • For syntax-highlighting, I’ve used the expressive-code package, that Astro uses for their documentation site too
  • For diagrams, i’ve added Mermaid support and also I’m generating some diagrams via Graphviz code
  • For rendering math expressions, I’ve imported a MathJax script from a CDN
  • Smooth transitions between pages with the help of View Transitions browser API