main pico / pkg / apps / prose / html / post.page.tmpl
Eric Bower  ·  2026-09-30
 1{{template "base" .}}
 2
 3{{define "title"}}{{.PageTitle}}{{end}}
 4
 5{{define "meta"}}
 6  {{if .Favicon}}
 7    <link rel="icon" href="{{.Favicon}}">
 8  {{else}}
 9    <link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
10  {{end}}
11
12  <meta name="description" content="{{.Description}}" />
13
14  <meta property="og:type" content="website">
15  <meta property="og:site_name" content="{{.Site.Domain}}">
16  <meta property="og:url" content="{{.URL}}">
17  <meta property="og:title" content="{{.Title}}">
18  {{if .Description}}<meta property="og:description" content="{{.Description}}">{{end}}
19
20  {{if .Image}}
21    <meta itemprop="image" content="{{.Image}}" />
22    <meta property="og:image" content="{{.Image}}" />
23    <meta name="twitter:image" content="{{.Image}}" />
24  {{else}}
25    <meta property="og:image:width" content="300" />
26    <meta property="og:image:height" content="300" />
27    <meta itemprop="image" content="https://{{.Site.Domain}}/card.png" />
28    <meta property="og:image" content="https://{{.Site.Domain}}/card.png" />
29    <meta name="twitter:image" content="https://{{.Site.Domain}}/card.png" />
30  {{end}}
31
32  {{if .ImageCard}}
33    <meta property="twitter:card" content="{{.ImageCard}}">
34  {{else}}
35    <meta property="twitter:card" content="summary">
36  {{end}}
37  <meta property="twitter:url" content="{{.URL}}">
38  <meta property="twitter:title" content="{{.Title}}">
39  {{if .Description}}<meta property="twitter:description" content="{{.Description}}">{{end}}
40
41  <link rel="stylesheet" href="/reset.css" />
42  <link rel="stylesheet" href="/syntax.css" />
43  {{if .HasCSS}}<link rel="stylesheet" href="{{.CssURL}}" />{{end}}
44{{end}}
45
46{{define "attrs"}}id="post" class="{{.Slug}}{{if .Unlisted}} post-draft{{end}}"{{end}}
47
48{{define "body"}}
49  <main>
50    <article class="md">
51      <header>
52        <h1>{{.Title}}</h1>
53        <p>
54          <time datetime="{{.PublishAtISO}}">{{.PublishAt}}</time>
55          <span>&middot;</span>
56          <a href="{{.BlogURL}}">{{.BlogName}}</a>
57          {{if .Description}}
58            <br />
59            <span>{{.Description}}</span>
60          {{end}}
61        </p>
62
63        <hr />
64      </header>
65
66      {{if .List}}
67        {{template "list" .List}}
68      {{else}}
69        {{.Contents}}
70      {{end}}
71
72      <footer>
73        <hr />
74        {{if or .Tags .UpdatedAt}}
75        <p>
76          {{if .Tags}}
77            {{range .Tags}}
78              <a href="{{$.BlogURL}}?tag={{.}}">#{{.}}</a>&nbsp;
79            {{end}}
80            {{if .UpdatedAt}}<br />{{end}}
81          {{end}}
82          {{if .UpdatedAt}}
83            <span>last updated: <time datetime="{{.UpdatedAtISO}}">{{.UpdatedAt}}</time></span>
84          {{end}}
85        </p>
86        {{end}}
87
88        {{if .Footer}}<div id="post-footer">{{.Footer}}</div>{{end}}
89      </footer>
90    </article>
91  </main>
92
93  {{template "footer" .}}
94{{end}}