pupate

No description provided
git clone https://git.woozle.org/neale/pupate.git

pupate / docs
Neale Pickett  ·  2025-03-25

main.go

 1package docs
 2
 3import (
 4	"embed"
 5
 6	"github.com/dirtbags/pupate/pkg/changelog"
 7)
 8
 9// FS contains built-in documentation.
10//
11//go:embed *
12var FS embed.FS
13
14// Version returns the current version and date.
15func Version() (version string, date string) {
16	return changelog.ReadVersionFS(FS)
17}
18
19// HtmlTemplateStr contains the template used to present documentation to the user.
20var HtmlTemplateStr = `<!DOCTYPE html>
21<html>
22  <head>
23    <title>{{or .Title .Name}} - Pupate Docs</title>
24    <link rel="stylesheet" href="/base.css">
25    <link rel="icon" href="/silk-cocoon.png">
26    <script src="/update-reload.mjs" type="module"></script>
27  </head>
28  <body>
29{{with .Title}}
30    <h1 class="title">{{.}}</h1>
31{{end}}
32    <section class="content">{{.Content | markdownify}}</section>
33    <footer>
34      <div>Pupate version {{.PupateVersion}} - {{.PupateDate}}</div>
35    </footer>
36  </body>
37</html>
38`