feat(template): add multiple page support to templates
build / Go-Build (push) Successful in 1m30s

This commit is contained in:
2026-05-27 22:02:11 +02:00
parent 2aab1bcdd2
commit ba2332ecb6
5 changed files with 76 additions and 36 deletions
+13 -6
View File
@@ -17,7 +17,7 @@ type downloadRequest struct {
}
type downloadResponse struct {
Url string
Urls []string
}
func DownloadSVG(w http.ResponseWriter, r *http.Request) {
@@ -73,16 +73,23 @@ func DownloadSVG(w http.ResponseWriter, r *http.Request) {
Keys: request.TemplateKeys,
}
filename, err := actions.ProvideFile(&templateParam, &convParam)
filenames, err := actions.ProvideFile(&templateParam, &convParam)
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
return
}
urlparsed := getPublicUrl(r, filename)
log.Printf("Made %s available as %s\n", id, urlparsed)
response := downloadResponse{
Url: urlparsed,
urlsparsed := make([]string, len(filenames))
for i, filename := range filenames {
urlsparsed[i] = getPublicUrl(r, filename)
log.Printf("Made %s page %d available as %s\n", id, i, urlsparsed[i])
}
response := downloadResponse{
Urls: urlsparsed,
}
w.Header().Add("Content-Type", "application/json")
json, err := json.Marshal(response)
if err != nil {