1-- A blog index: a layout function with named slots, posts loaded from JSON,
2-- and loops and conditions over records.
3@page [lang=en] Notes on the Web
4@meta description Short essays on static HTML, layout and tooling.
11-- Posts are records: $post.title, $post.tags, ...
12@data $posts posts.json
14-- A layout is an ordinary function. @slot blocks are filled by name; the
15-- rest of the caller's content replaces @children.
17 @el [width fill, max-width 720, center-x, padding 48 24, spacing 40, color var(--ink), line-height 1.6]
19 @link [font-weight 800, font-size 28, letter-spacing -0.5] / Notes on the Web
21 @text [color var(--muted)] Short essays.
24 @footer [padding-block-start 24, border-top 1 solid var(--line), color var(--muted), font-size 14]
36 hover:background #dbeafe
40-- A post summary. `featured` is optional: a parameter with a default
41@let @post-card [post, featured false]
45 if($featured, [padding 24, background #f8fafc, border 1 solid var(--line)])
48 @text [font-size 12, font-weight 700, text-transform uppercase, letter-spacing 1, color var(--accent)] Featured
49 @h2 [font-size 22, line-height 1.3]
50 @link [hover:color var(--accent)] /posts/$post.slug $post.title
51 @row [spacing 8, align-items center, wrap, font-size 14, color var(--muted)]
52 @time [datetime=$post.date] $post.display_date
54 @each $name in $post.tags
56 @paragraph [color var(--muted), line-clamp 2] $post.summary
58-- Multi-line content: a function whose body is text
60 I write about building for the web with as little machinery as possible:
61 plain HTML, a little CSS, and tools that {@em stay out of the way}.
65 @paragraph [color var(--muted)]
70 @post-card [post $post, featured $post.featured]
72 @text [color var(--muted)] Nothing here yet.
75 @h2 [font-size 18] Tooling posts
76 @ul [spacing 4, list-style disc, padding-inline-start 20, children:display list-item]
78 @if contains($post.tags, tooling)
80 @link [color var(--accent), hover:text-decoration underline] /posts/$post.slug $post.title
84 @text ${length($posts)} posts
86 @link [hover:color var(--ink)] /feed.xml RSS
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list