diff options
Diffstat (limited to 'home.go')
| -rw-r--r-- | home.go | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -2,14 +2,14 @@ package main import ( "html/template" - "io/ioutil" + "io/fs" "log" "net/http" "github.com/gomarkdown/markdown" ) var templateIndexFiles = []string{ "templates/base.html", "templates/index.html" } -var templateIndex = template.Must(template.ParseFiles(templateIndexFiles...)) +var templateIndex = template.Must(template.ParseFS(Assets, templateIndexFiles...)) var contentHTML template.HTML // just display README.md type IndexTemplateData struct { @@ -17,7 +17,7 @@ type IndexTemplateData struct { } func loadReadme() { - mdBytes, err := ioutil.ReadFile("README.md") + mdBytes, err := fs.ReadFile(Assets, "README.md") if err != nil { log.Fatalf("Failed to read markdown file: %v", err) } |
