Split site to separate files

This commit is contained in:
nxshock 2021-09-25 12:38:27 +05:00
parent a0e0b7b1cc
commit b0f9ea1f49
7 changed files with 108 additions and 10 deletions

View file

@ -1,19 +1,13 @@
package main
import (
"embed"
"html/template"
"log"
"net/http"
"os"
"time"
_ "embed"
)
//go:embed templates/genres.html
var templateBytes embed.FS
var templates *template.Template
func init() {
@ -45,7 +39,7 @@ func init() {
func initTepmplates() error {
var err error
templates, err = template.ParseFS(templateBytes, "templates/*.html")
templates, err = template.ParseFS(siteFS, "site/*.htm")
if err != nil {
return err
}