Template updates (commit: 11682a3)
All checks were successful
Push to GitHub / mirror (push) Successful in 4s

This commit is contained in:
2025-12-31 23:14:22 +01:00
parent bdb0084f72
commit 7f09e3dae1
10 changed files with 313 additions and 0 deletions

26
version.go Normal file
View File

@@ -0,0 +1,26 @@
package main
import (
_ "embed"
"html/template"
"net/http"
)
//go:embed templates/html/version.html
var versionTemplate string
func handleVersion(w http.ResponseWriter, r *http.Request) {
type SiteInfo struct {
CommitId string
Name string
Version string
}
tmpl, _ := template.New("version.html").Parse(versionTemplate)
// Return (write) the version to the response body
tmpl.Execute(w, SiteInfo{
CommitId: COMMIT_ID,
Name: "YASKM",
Version: APP_VERSION,
})
}