diff options
| author | Grégoire Duchêne <gduchene@awhk.org> | 2022-01-30 13:56:41 +0000 |
|---|---|---|
| committer | Grégoire Duchêne <gduchene@awhk.org> | 2022-01-30 13:56:41 +0000 |
| commit | 3093c4cffa82211fd8ab3a141e54fcf9c10a8012 (patch) | |
| tree | b4c5fcbb342afca310a9fe5807ea9d6e99bb644b | |
| parent | 359f6416cce4eb19389f414a58209cd20915656f (diff) | |
Move response template to resp.html
| -rw-r--r-- | resp.go | 11 | ||||
| -rw-r--r-- | resp.html | 3 |
2 files changed, 10 insertions, 4 deletions
@@ -4,6 +4,7 @@ package main import ( + _ "embed" "log" "net/http" "path" @@ -11,10 +12,12 @@ import ( "text/template" ) -var body = template.Must(template.New("").Parse(`<!doctype html> -<meta name="go-import" content="{{.Package}} {{.VCS}} {{.Repository}}"> -<title>go-import-redirect</title> -`)) +var ( + body = template.Must(template.New("").Parse(tmpl)) + + //go:embed resp.html + tmpl string +) type bodyData struct{ Package, Repository, VCS string } diff --git a/resp.html b/resp.html new file mode 100644 index 0000000..422024a --- /dev/null +++ b/resp.html @@ -0,0 +1,3 @@ +<!doctype html> +<meta name="go-import" content="{{.Package}} {{.VCS}} {{.Repository}}"> +<title>go-import-redirect</title> |
