Name

html-is-a-tree

I use a static site generator to build this site, but I keep hitting its limitations.

Introduction

A long while ago, I used clojure for some web development and used hiccup-style html templates for the first time. For the uninitiated, clojure is a lisp dialect. This makes it possible directly represent tree structures. For example, here is an HTML document:

[:html
[:head
[:link { :rel "stylesheet" :href "/style.css" }]]
[:body
[:article
[:h1 "Hello world!"]
[:p "This clojure data structure directly encodes an HTML document."]]]]

One can do more than just write static documents this way, as it becomes very easy to directly inject new structure using code:

(let [posts (load-documents "posts/**/*.md")]
[:html
[:head
[:link ...

Similar Posts

Loading similar posts...

Keyboard Shortcuts

Navigation
Next / previous item
j/k
Open post
oorEnter
Preview post
v
Post Actions
Love post
a
Like post
l
Dislike post
d
Undo reaction
u
Recommendations
Add interest / feed
Enter
Not interested
x
Go to
Home
gh
Interests
gi
Feeds
gf
Likes
gl
History
gy
Changelog
gc
Settings
gs
Browse
gb
Search
/
General
Show this help
?
Submit feedback
!
Close modal / unfocus
Esc

Press ? anytime to show this help