fix: use explicit if/else template dispatch instead of dynamic name
Some checks failed
Build and Push Docker Image / build-and-push (push) Failing after 6s
Mirror to GitHub / mirror (push) Failing after 3s
Tests / test (push) Failing after 32s

html/template requires template names to be string literals, not field
accesses. Use {{if eq .Template "videos"}} to branch and call the
appropriate template by literal name.
This commit is contained in:
Franz Kafka 2026-03-22 02:46:28 +00:00
parent a8104da887
commit ccb985d40c

View file

@ -52,7 +52,11 @@
<div id="urls" role="main">
{{if .Results}}
{{range .Results}}
{{template .TemplateName .}}
{{if eq .Template "videos"}}
{{template "video_item" .}}
{{else}}
{{template "result_item" .}}
{{end}}
{{end}}
{{else if not .Answers}}
<div class="no_results">