~erock/pico

ref: 0515a612f9cd7fec41f4d1befac9a29b297aa1c8 pico/prose/html/post.page.tmpl -rw-r--r-- 1.8 KiB
0515a612Eric Bower feat: tag posts with slug as classname on body 3 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
{{template "base" .}}

{{define "title"}}{{.PageTitle}}{{end}}

{{define "meta"}}
<meta name="description" content="{{.Description}}" />

<meta property="og:type" content="website">
<meta property="og:site_name" content="{{.Site.Domain}}">
<meta property="og:url" content="{{.URL}}">
<meta property="og:title" content="{{.Title}}">
{{if .Description}}<meta property="og:description" content="{{.Description}}">{{end}}
<meta property="og:image:width" content="300" />
<meta property="og:image:height" content="300" />
<meta itemprop="image" content="https://{{.Site.Domain}}/card.png" />
<meta property="og:image" content="https://{{.Site.Domain}}/card.png" />

<meta property="twitter:card" content="summary">
<meta property="twitter:url" content="{{.URL}}">
<meta property="twitter:title" content="{{.Title}}">
{{if .Description}}<meta property="twitter:description" content="{{.Description}}">{{end}}
<meta name="twitter:image" content="https://{{.Site.Domain}}/card.png" />
<meta name="twitter:image:src" content="https://{{.Site.Domain}}/card.png" />

<link rel="stylesheet" href="/syntax.css" />
{{if .HasCSS}}<link rel="stylesheet" href="{{.CssURL}}" />{{end}}
{{end}}

{{define "attrs"}}id="post" class="{{.Slug}}"{{end}}

{{define "body"}}
<header>
    <h1 class="text-2xl font-bold">{{.Title}}</h1>
    <p class="font-bold m-0">
        <time datetime="{{.PublishAtISO}}">{{.PublishAt}}</time>
        <span> on </span>
        <a href="{{.BlogURL}}">{{.BlogName}}</a></p>
    {{if .Description}}<div class="my font-italic">{{.Description}}</div>{{end}}
    <div class="tags">
    {{range .Tags}}
        <a class="tag" href="{{$.BlogURL}}?tag={{.}}">#{{.}}</a>
    {{end}}
    </div>
</header>
<main>
    <article class="md">
        {{.Contents}}
    </article>
</main>
{{template "footer" .}}
{{end}}