Setup for being a library
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"embed"
|
||||||
"fmt"
|
"fmt"
|
||||||
"html/template"
|
"html/template"
|
||||||
"image/color"
|
"image/color"
|
||||||
@@ -12,7 +13,7 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"test-maze/maze"
|
maze "tea.chunkbyte.com/kato/go-maze/maze"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
@@ -41,7 +42,10 @@ type mazeParams struct {
|
|||||||
SolveB uint8
|
SolveB uint8
|
||||||
}
|
}
|
||||||
|
|
||||||
var pageTmpl = template.Must(template.ParseFiles("templates/index.html"))
|
//go:embed templates/index.html
|
||||||
|
var templatesFS embed.FS
|
||||||
|
|
||||||
|
var pageTmpl = template.Must(template.ParseFS(templatesFS, "templates/index.html"))
|
||||||
|
|
||||||
type pageData struct {
|
type pageData struct {
|
||||||
mazeParams
|
mazeParams
|
||||||
Reference in New Issue
Block a user