repos / pgit

static site generator for git
git clone https://github.com/picosh/pgit.git

pgit / html
Eric Bower · 19 Aug 23

file.page.tmpl

 1{{template "base" .}}
 2{{define "title"}}{{.Item.Path}}@{{.RevData.Name}}{{end}}
 3{{define "meta"}}
 4<link rel="stylesheet" href="/syntax.css" />
 5{{end}}
 6
 7{{define "content"}}
 8  <div class="text-md">
 9    {{range .Item.Crumbs}}
10      <a href="{{.URL}}">{{.Text}}</a> {{if .IsLast}}{{else}}/{{end}}
11    {{end}}
12  </div>
13
14  {{if .Repo.HideTreeLastCommit}}
15  {{else}}
16  <div class="box">
17    <div class="flex items-center justify-between">
18      <div class="flex-1">
19        <a href="{{.Item.CommitURL}}">{{.Item.Summary}}</a>
20      </div>
21      <div>
22        <a href="{{.Item.CommitURL}}">{{.Item.CommitID}}</a>
23      </div>
24    </div>
25
26    <div class="flex items-center gap-xs">
27      <span>{{.Item.Author.Name}}</span>
28      <span>&centerdot;</span>
29      <span>{{.Item.When}}</span>
30    </div>
31  </div>
32  {{end}}
33
34  <h2 class="text-lg">{{.Item.Name}}</h2>
35
36  {{.Contents}}
37{{end }}