Fix blank episode form: move all CSS to external static files
Build and Deploy / build-and-deploy (push) Successful in 47s
Build and Deploy / build-and-deploy (push) Successful in 47s
- Go html/template rejects <style> blocks and inline style attributes when template expressions are present in URL/CSS contexts - Move all inline CSS to static/auth.css, static/episode.css, static/dashboard.css - Serve static files from embedded FS via /static/ handler - Fix missing </div> in episode form audio file group
This commit is contained in:
@@ -15,6 +15,9 @@ import (
|
||||
//go:embed template/*.html
|
||||
var templateFS embed.FS
|
||||
|
||||
//go:embed static/*
|
||||
var staticFS embed.FS
|
||||
|
||||
func main() {
|
||||
dbPath := os.Getenv("PODSTALK_DB")
|
||||
if dbPath == "" {
|
||||
@@ -81,6 +84,8 @@ func main() {
|
||||
|
||||
// Public uploaded files.
|
||||
http.HandleFunc("/uploads/", epH.ServeUpload)
|
||||
// Static files.
|
||||
http.Handle("/static/", http.FileServer(http.FS(staticFS)))
|
||||
|
||||
port := envOrDefault("PORT", "8080")
|
||||
addr := fmt.Sprintf(":%s", port)
|
||||
|
||||
Reference in New Issue
Block a user