diff options
Diffstat (limited to 'pkg/tpl/random.templ')
-rw-r--r-- | pkg/tpl/random.templ | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/pkg/tpl/random.templ b/pkg/tpl/random.templ new file mode 100644 index 0000000..63e7c03 --- /dev/null +++ b/pkg/tpl/random.templ @@ -0,0 +1,18 @@ +package tpl + +import "sh.org.ru/pkg/model" +import "math/rand" +import "fmt" + +templ Random(quotes []model.Quote) { + @Layout(HeaderParams{ + Title: "Цитатник Рунета -- случайные", + Description: "Новый цитатник Рунета", + URL: "https://sh.org.ru/random", + }) { + for _, q := range quotes { + @Quote(&q) + } + <a role="button" href={templ.URL(fmt.Sprintf("/random?%d", rand.Int()))}>Обновить</a> + } +} |