mirror of
https://github.com/nxshock/promodj.git
synced 2025-07-05 00:23:11 +05:00
Make html templates separate from site files
This commit is contained in:
parent
b0f9ea1f49
commit
379450c70f
3 changed files with 24 additions and 13 deletions
24
templates.go
Normal file
24
templates.go
Normal file
|
@ -0,0 +1,24 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"embed"
|
||||
"html/template"
|
||||
)
|
||||
|
||||
var templates *template.Template
|
||||
|
||||
//go:embed templates/*.htm
|
||||
var templatesFS embed.FS
|
||||
|
||||
func initTepmplates() error {
|
||||
var err error
|
||||
|
||||
templates, err = template.ParseFS(templatesFS, "templates/*.htm")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
templatesFS = embed.FS{}
|
||||
|
||||
return nil
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue