diff --git a/data.go b/data.go index 7c976e7..49df295 100644 --- a/data.go +++ b/data.go @@ -25,6 +25,7 @@ type Person struct { type Tag struct { Name string `json:"name"` Description string `json:"description"` + Link string `json:"link"` } type Color struct { diff --git a/index.ts b/index.ts index 77a004a..e4b19d6 100644 --- a/index.ts +++ b/index.ts @@ -1,7 +1,9 @@ function setupEvents() { document.querySelectorAll(".tag")?.forEach(t => { t.addEventListener("click", _ => { - // t.classList.toggle("active") + const link = t.getAttribute("data-href") + if (link === null || link === "") return + window.open(link) }) }) diff --git a/schema.json b/schema.json index d73f3db..2678ecf 100644 --- a/schema.json +++ b/schema.json @@ -155,12 +155,16 @@ }, "name": { "type": "string" + }, + "link": { + "type": "string" } }, "additionalProperties": false, "required": [ "name", - "description" + "description", + "link" ] } } diff --git a/templates/page/tags.gohtml b/templates/page/tags.gohtml index 4713ff4..8a81810 100644 --- a/templates/page/tags.gohtml +++ b/templates/page/tags.gohtml @@ -3,7 +3,7 @@

Tags

{{ range $tag := .Person.Tags }} -
+

{{ .Name }}

{{ .Description }}