summaryrefslogtreecommitdiff
path: root/site.tmpl
diff options
context:
space:
mode:
Diffstat (limited to 'site.tmpl')
-rw-r--r--site.tmpl90
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 &amp; 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="#">&larr; prev</a><a href="#">rand</a><a href="#">next &rarr;</a>
+ </div> -->
+ <p>&copy;2026 tjp &middot; content <a href="https://creativecommons.org/licenses/by/4.0/">CC BY 4.0</a> unless noted &middot; <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;">&larr; weblog</a> &nbsp;/&nbsp; <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"}}">&larr; Older</a>
+ <a href="{{rel .OutputPath "weblog/index.html"}}">All posts</a>
+ <a href="{{rel .OutputPath "weblog/index.html"}}">Newer &rarr;</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;">&larr; notes</a></p>
+ <h1>{{.Title}}</h1>
+ </div>
+
+ <div class="note-body">
+ {{joinSections .Sections}}
+ </div>
+ </article>
+ </main>
+
+{{template "footer" .}}{{end}}