Break the menu out into a separate template

This commit is contained in:
2021-09-30 17:46:01 +09:30
parent 43baca27ab
commit 49479e7eee
5 changed files with 21 additions and 16 deletions

View File

@@ -104,7 +104,7 @@ func HomeHandler(w http.ResponseWriter, r *http.Request) {
bookmarkletURL := fmt.Sprintf("javascript:(function(f,s,n,o){window.open(f+encodeURIComponent(s),n,o)}('%s/fetch?url=',window.location,'yourform','width=%d,height=%d'));", conf.Server.Address, conf.UI.PopupWidth, conf.UI.PopupHeight)
t, err := template.ParseFS(webFS, "web/layout.tmpl", "web/index.html")
t, err := template.ParseFS(webFS, "web/layout.tmpl", "web/menu.tmpl", "web/index.html")
if err != nil {
panic(err)
}
@@ -129,7 +129,7 @@ func HomeHandler(w http.ResponseWriter, r *http.Request) {
func ConfigHandler(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusOK)
t, err := template.ParseFS(webFS, "web/layout.tmpl", "web/config.html")
t, err := template.ParseFS(webFS, "web/layout.tmpl", "web/menu.tmpl", "web/config.html")
if err != nil {
panic(err)
}