about summary refs log tree commit diff stats
path: root/internal/builder/tags.templ
blob: 14abca40612934407383ed17945938c277abceb3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package builder

import "website/internal/config"

templ tagLink(tag string, attrs templ.Attributes) {
	<a { attrs... } href={ templ.SafeURL("/tags/" + tag) }>#{ tag }</a>
}

templ tagsPage(config config.Config, title string, tags []string, path string) {
	@page(config, PageSettings{
		Title: title,
		Path:  path,
	}) {
		<h3 class="filter">Tags</h3>
		<ul class="tags">
			for _, tag := range tags {
				<li class="h-feed">
					@tagLink(tag, templ.Attributes{})
				</li>
			}
		</ul>
	}
}