diff --git a/golink.go b/golink.go
index c4b005c..44fe1d4 100644
--- a/golink.go
+++ b/golink.go
@@ -4,6 +4,7 @@ package main
import (
"bufio"
"bytes"
+ "embed"
_ "embed"
"encoding/json"
"flag"
@@ -41,6 +42,9 @@ var stats struct {
//go:embed link-snapshot.json
var lastSnapshot []byte
+//go:embed *.html
+var embeddedFS embed.FS
+
var localClient *tailscale.LocalClient
// DiskLink is the JSON structure stored on disk in a file for each go short link.
@@ -126,24 +130,7 @@ type homeData struct {
}
func init() {
- homeCreate = template.Must(template.New("home").Parse(`
-
-go/
-shortlink service.
-
-create
-
-
-recent popular links
-
-`))
+ homeCreate = template.Must(template.ParseFS(embeddedFS, "home.html"))
}
func linkPath(short string) string {
diff --git a/home.html b/home.html
new file mode 100644
index 0000000..df1df0f
--- /dev/null
+++ b/home.html
@@ -0,0 +1,17 @@
+
+
+go/
+shortlink service.
+
+create
+
+
+recent popular links
+