Compare commits
2 commits
f94e307bc8
...
2c078285b8
Author | SHA1 | Date | |
---|---|---|---|
Chandler Swift | 2c078285b8 | ||
Chandler Swift | c97321beae |
2
Makefile
2
Makefile
|
@ -1,2 +1,2 @@
|
|||
minecraft-site:
|
||||
minecraft-site: minecraft-site.go index.html go.mod go.sum
|
||||
go build -tags netgo -ldflags '-extldflags "-static"'
|
||||
|
|
|
@ -2,6 +2,7 @@ package main
|
|||
|
||||
import (
|
||||
"crypto/tls"
|
||||
_ "embed"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"html/template"
|
||||
|
@ -35,6 +36,9 @@ type pageData struct {
|
|||
Servers []server
|
||||
}
|
||||
|
||||
//go:embed index.html
|
||||
var indexhtml string
|
||||
|
||||
func main() {
|
||||
|
||||
// Parse config file
|
||||
|
@ -63,7 +67,7 @@ func main() {
|
|||
|
||||
// Set up templates
|
||||
fmt.Print("Parsing templates...\n")
|
||||
t, err := template.ParseFiles("templates/index.html")
|
||||
t, err := template.New("").Parse(indexhtml)
|
||||
if err != nil {
|
||||
log.Fatalf("Error parsing HTML template: %v\n", err)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue