aboutsummaryrefslogtreecommitdiff
path: root/resources.go
diff options
context:
space:
mode:
authorRunxi Yu <me@runxiyu.org>2025-03-31 00:56:53 +0800
committerRunxi Yu <me@runxiyu.org>2025-03-31 00:57:42 +0800
commitf16f2caba7e516ba5a7e78f14be35a9e066c3fea (patch)
tree6a8b9347c99f9db8bc4e412a72a4041471b5411b /resources.go
parentAdd repo tab navigation to all pages (diff)
downloadforge-f16f2caba7e516ba5a7e78f14be35a9e066c3fea.tar.gz
forge-f16f2caba7e516ba5a7e78f14be35a9e066c3fea.tar.zst
forge-f16f2caba7e516ba5a7e78f14be35a9e066c3fea.zip
Mandoc more
Diffstat (limited to 'resources.go')
-rw-r--r--resources.go10
1 files changed, 8 insertions, 2 deletions
diff --git a/resources.go b/resources.go
index 6d32136..995fb2e 100644
--- a/resources.go
+++ b/resources.go
@@ -20,7 +20,7 @@ import (
//go:embed *.go go.mod go.sum
//go:embed *.scfg
//go:embed Makefile
-//go:embed static/* templates/* scripts/* sql/*
+//go:embed static/* templates/* scripts/* sql/* man/*
//go:embed hookc/*.c
//go:embed vendor/*
var sourceFS embed.FS
@@ -30,7 +30,7 @@ var sourceHandler = http.StripPrefix(
http.FileServer(http.FS(sourceFS)),
)
-//go:embed templates/* static/* hookc/hookc
+//go:embed templates/* static/* hookc/hookc man/*.html man/*.txt man/*.css
var resourcesFS embed.FS
var templates *template.Template
@@ -78,6 +78,7 @@ func loadTemplates() (err error) {
}
var staticHandler http.Handler
+var manHandler http.Handler
func init() {
staticFS, err := fs.Sub(resourcesFS, "static")
@@ -85,4 +86,9 @@ func init() {
panic(err)
}
staticHandler = http.StripPrefix("/:/static/", http.FileServer(http.FS(staticFS)))
+ manFS, err := fs.Sub(resourcesFS, "man")
+ if err != nil {
+ panic(err)
+ }
+ manHandler = http.StripPrefix("/:/man/", http.FileServer(http.FS(manFS)))
}