From 103e84d847262830bbaa550b37218e9ca8b317d3 Mon Sep 17 00:00:00 2001 From: Himanshu Sardana Date: Thu, 26 Mar 2026 21:26:35 +0000 Subject: refactor: split into cmd, pkg --- output/1/index.html | 283 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 283 insertions(+) create mode 100644 output/1/index.html (limited to 'output/1/index.html') diff --git a/output/1/index.html b/output/1/index.html new file mode 100644 index 0000000..0d04be8 --- /dev/null +++ b/output/1/index.html @@ -0,0 +1,283 @@ + + + + + + + Writing a static site generator for fun and profit + + + + + + + + + +
+ + +

Writing a static site generator for fun and profit

+

Tired of bloated Next.js projects taking up 100MBs of RAM on my VPS, I decided +to shift my personal site to a more minimal framework. Remembering Luke +Smith’s old video about Hugo, I decided +to give it a try. I was thinking of writing my own Hugo Theme when I had the +“bright” idea of writing my very own static site generator instead.

+ +
+

Enter Kite

+
+ +

How an SSG works

+ +

A static site generator takes in a directory full of markdown files and +converts them plain-old HTML files while maintaining a theme. For my use-case, +since I mainly wanted a blog, the most important page would be the post +page.

+ +

The Page struct can therefore be defined as:

+ +
type Page struct {
+	Title   string
+	Content template.HTML
+	TOC     []TOCItem
+}
+
+ +

Parsing Frontmatter

+ +

Frontmatter is the small YAML-like block at the top of each markdown file +containing info such as the post title, it’s date, tags etc.

+ +
type Frontmatter struct {
+	Title string   `yaml:"title"`
+	Date  string   `yaml:"date"`
+	Tags  []string `yaml:"tags"`
+}
+
+ +
+ + + + -- cgit v1.3.1