diff options
| author | Tim Keller <tjk@tjkeller.xyz> | 2026-09-22 17:12:59 -0500 |
|---|---|---|
| committer | Tim Keller <tjk@tjkeller.xyz> | 2026-09-22 17:12:59 -0500 |
| commit | 55c7c104c0d548837c510ca831e0f1f29c210323 (patch) | |
| tree | 701d392bad5d866316ca25e1cf5505cb9fc4573c /home.go | |
| parent | 4407433bd31df5526df0dd167d2d9d9d878a09d1 (diff) | |
| download | embedtube-55c7c104c0d548837c510ca831e0f1f29c210323.tar.xz embedtube-55c7c104c0d548837c510ca831e0f1f29c210323.zip | |
use embed fs and add options for host and port + api_key_file
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) } |
