diff options
| author | Himanshu Sardana <himanshusardana2005@gmail.com> | 2026-03-26 21:26:35 +0000 |
|---|---|---|
| committer | Himanshu Sardana <himanshusardana2005@gmail.com> | 2026-03-26 21:26:35 +0000 |
| commit | 103e84d847262830bbaa550b37218e9ca8b317d3 (patch) | |
| tree | e19d3bfd6594600fb28be1ccac1a3869207bc49c /content | |
| parent | 5c631f0cdb8ee3238ff054d171dd8babd158047b (diff) | |
refactor: split into cmd, pkg
Diffstat (limited to 'content')
| -rw-r--r-- | content/1.md | 40 | ||||
| -rw-r--r-- | content/2.md | 6 |
2 files changed, 46 insertions, 0 deletions
diff --git a/content/1.md b/content/1.md new file mode 100644 index 0000000..e2a8df1 --- /dev/null +++ b/content/1.md @@ -0,0 +1,40 @@ +--- +title: Writing a static site generator for fun and profit +date: 24/3/26 +--- + +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](https://www.youtube.com/@LukeSmithxyz)'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: + +```go +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. + +```go +type Frontmatter struct { + Title string `yaml:"title"` + Date string `yaml:"date"` + Tags []string `yaml:"tags"` +} +``` diff --git a/content/2.md b/content/2.md new file mode 100644 index 0000000..74c94af --- /dev/null +++ b/content/2.md @@ -0,0 +1,6 @@ +--- +title: Kite Devlog Adding Live Reload +date: 26/3/26 +--- + +I decided to write my own Live Reload to work with [Kite](https://github.com/HimanshuSardana/kite). |
