about summary refs log tree commit diff stats
path: root/templates/tags.templ
blob: 7218ca1c204feefd8a5c5314d292f31ab683ce38 (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 templates

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>
	}
}