Move all html/js templates under static/

This commit is contained in:
Daniele Tonon
2023-05-26 17:54:58 +02:00
parent 9deaa1e410
commit c43de7478b
9 changed files with 4 additions and 5 deletions

View File

@@ -10,18 +10,17 @@ import (
"strings" "strings"
"text/template" "text/template"
"time" "time"
"github.com/nbd-wtf/go-nostr" "github.com/nbd-wtf/go-nostr"
"github.com/nbd-wtf/go-nostr/nip19" "github.com/nbd-wtf/go-nostr/nip19"
) )
//go:embed raw.html //go:embed static/raw.html
var rawHTML string var rawHTML string
//go:embed profile.html //go:embed static/profile.html
var profileHTML string var profileHTML string
//go:embed note.html //go:embed static/note.html
var noteHTML string var noteHTML string
func render(w http.ResponseWriter, r *http.Request) { func render(w http.ResponseWriter, r *http.Request) {
@@ -200,7 +199,7 @@ func render(w http.ResponseWriter, r *http.Request) {
tmpl, err := template.Must(template.New("event"). tmpl, err := template.Must(template.New("event").
Funcs(funcMap). Funcs(funcMap).
Parse(templates[typ])). Parse(templates[typ])).
ParseFiles("head.html", "top.html", "column_clients.html", "footer.html", "scripts.js") ParseFiles("static/head.html", "static/top.html", "static/column_clients.html", "static/footer.html", "static/scripts.js")
if err != nil { if err != nil {
// Handle error // Handle error
} }