diff options
| author | t <t@tjp.lol> | 2026-07-11 12:08:14 -0600 |
|---|---|---|
| committer | t <t@tjp.lol> | 2026-07-11 12:10:15 -0600 |
| commit | 2ab0e23eca3c5cac82d948e506b3f1cb81bedd18 (patch) | |
| tree | 46dc28dcea6265ece0f4763cdff372f84578e172 /site.tmpl | |
| parent | 9faffbf6bc5083239d69a2daedac273e6d814bc3 (diff) | |
Migrate site pages to Weft templates and Markdown
Diffstat (limited to 'site.tmpl')
| -rw-r--r-- | site.tmpl | 90 |
1 files changed, 90 insertions, 0 deletions
diff --git a/site.tmpl b/site.tmpl new file mode 100644 index 0000000..6c60443 --- /dev/null +++ b/site.tmpl @@ -0,0 +1,90 @@ +{{define "head"}}<!DOCTYPE html> +<html lang="en"> +<head> +<meta charset="utf-8"> +<meta name="viewport" content="width=device-width, initial-scale=1"> +<title>{{if eq .OutputPath "about/index.html"}}About & colophon{{else}}{{.Title}}{{end}} — tjp.lol</title> +{{with index .Meta "description"}}<meta name="description" content="{{.}}"> +{{end}}<link rel="stylesheet" href="{{rel .OutputPath "style.css"}}"> +{{if or (eq .OutputPath "weblog/index.html") (index .Meta "post_date")}}<link rel="alternate" type="application/atom+xml" title="tjp.lol" href="{{rel .OutputPath "feed.xml"}}"> +{{end}}</head> +<body> +<div class="wrap"> +{{end}} + +{{define "header"}} <header class="site"> + <h1 class="brand"><a href="{{rel .OutputPath "index.html"}}">~tjp<span class="cur"> $_</span></a></h1> + {{if eq .OutputPath "index.html"}}<p class="tag">Elder-millennial software engineer in Salt Lake City, Utah. Writing about code, tools, and the small web.</p> + {{end}}<nav class="main"> + <a href="{{rel .OutputPath "weblog/index.html"}}"{{if eq .OutputPath "weblog/index.html"}} aria-current="page"{{end}}>weblog</a> + <!-- <a href="{{rel .OutputPath "notes/index.html"}}"{{if eq .OutputPath "notes/index.html"}} aria-current="page"{{end}}>notes</a> --> + <a href="{{rel .OutputPath "projects/index.html"}}"{{if eq .OutputPath "projects/index.html"}} aria-current="page"{{end}}>projects</a> + <a href="{{rel .OutputPath "about/index.html"}}"{{if eq .OutputPath "about/index.html"}} aria-current="page"{{end}}>about</a> + <a href="{{rel .OutputPath "feed.xml"}}">feed</a> + </nav> + </header> +{{end}} + +{{define "footer"}} <footer> + <!-- <div class="ring"> + <span>webring:</span> + <a href="#">← prev</a><a href="#">rand</a><a href="#">next →</a> + </div> --> + <p>©2026 tjp · content <a href="https://creativecommons.org/licenses/by/4.0/">CC BY 4.0</a> unless noted · <a href="{{rel .OutputPath "feed.xml"}}">feed</a></p> + </footer> + +</div> +</body> +</html> +{{end}} + +{{define "page"}}{{template "head" .}}{{template "header" .}} + <main> + <article class="post"> + <div class="post-head"> + <h1>{{.Title}}</h1> + </div> + <div class="note-body"> + {{joinSections .Sections}} + </div> + </article> + </main> + +{{template "footer" .}}{{end}} + +{{define "weblog"}}{{template "head" .}}{{template "header" .}} + <main> + <article class="post"> + <div class="post-head"> + <p class="meta"><a href="{{rel .OutputPath "weblog/index.html"}}" style="text-decoration:none;">← weblog</a> / <time datetime="{{date (index .Meta "post_date") "2006-01-02"}}">{{date (index .Meta "post_date") "2006-01-02"}}</time></p> + <h1>{{.Title}}</h1> + </div> + + {{with index .Sections 0}}<div style="font-size:1.2em">{{.}}</div>{{end}} + {{joinSections (slice .Sections 1)}} + </article> + + <nav class="post-nav"> + <a href="{{rel .OutputPath "weblog/index.html"}}">← Older</a> + <a href="{{rel .OutputPath "weblog/index.html"}}">All posts</a> + <a href="{{rel .OutputPath "weblog/index.html"}}">Newer →</a> + </nav> + </main> + +{{template "footer" .}}{{end}} + +{{define "note"}}{{template "head" .}}{{template "header" .}} + <main> + <article class="post"> + <div class="post-head"> + <p class="meta"><a href="{{rel .OutputPath "notes/index.html"}}" style="text-decoration:none;">← notes</a></p> + <h1>{{.Title}}</h1> + </div> + + <div class="note-body"> + {{joinSections .Sections}} + </div> + </article> + </main> + +{{template "footer" .}}{{end}} |
