~andreafeletto/gmnimetr

b698b0cc167432e314d348902cdd0f7a7e712392 — Andrea Feletto a month ago 1ca3822
move templates into a directory
3 files changed, 3 insertions(+), 3 deletions(-)

M main.go
R forecast.gmi => templates/forecast.gmi
R missing.gmi => templates/missing.gmi
M main.go => main.go +3 -3
@@ 14,7 14,7 @@ import (
	"text/template"
)

//go:embed *.gmi
//go:embed templates/*.gmi
var templateFiles embed.FS

//go:embed apiurl


@@ 78,7 78,7 @@ func renderTemplate(templateName string, data interface{}) error {
// Render the tamplate "forecast.gmi" and execute it with `data`.
// In case of errors, an error is returned with the appropriate <META> string.
func renderForecast(data ApiResult) error {
	return renderTemplate("forecast.gmi", data)
	return renderTemplate("templates/forecast.gmi", data)
}

// Render the tamplate "missing.gmi" and execute it with a payload containing


@@ 91,7 91,7 @@ func renderMissing(loc string) error {
	data := Payload{
		Location: loc,
	}
	return renderTemplate("missing.gmi", data)
	return renderTemplate("templates/missing.gmi", data)
}

// Get the requested location from the `QUERY_STRING` environment variable.

R forecast.gmi => templates/forecast.gmi +0 -0
R missing.gmi => templates/missing.gmi +0 -0