diff options
| -rw-r--r-- | data.go | 1 | ||||
| -rw-r--r-- | index.ts | 9 | ||||
| -rw-r--r-- | main.go | 4 | ||||
| -rw-r--r-- | scss/tag.scss | 1 | ||||
| -rw-r--r-- | templates/page/now.gohtml | 6 |
5 files changed, 7 insertions, 14 deletions
@@ -55,6 +55,7 @@ type Tag struct { Name string `json:"name" toml:"name"` Description string `json:"description" toml:"description"` Link string `json:"link" toml:"link"` + LinkName string `json:"link_name" toml:"link_name"` } type Color struct { @@ -1,13 +1,4 @@ function setupEvents() { - document.querySelectorAll<HTMLElement>(".tag")?.forEach(t => { - t.addEventListener("click", _ => { - const link = t.getAttribute("data-href") - if (link === null || link === "") return - if (!link.startsWith(window.location.origin) && link.startsWith("https://")) window.open(link) - else changePage(link) - }) - }) - document.querySelectorAll<HTMLAnchorElement>("a")?.forEach(a => { a.addEventListener("click", e => { if (!a.href.startsWith(window.location.origin)) return @@ -186,8 +186,8 @@ func generateConfigFile(isToml bool) { Pronouns: "any", Image: "pfp.webp", Tags: []*Tag{ - {"Hello", "World", ""}, - {"I am", "a tag", ""}, + {"Hello", "World", "", ""}, + {"I am", "a tag", "", ""}, }, }, Color: &Color{ diff --git a/scss/tag.scss b/scss/tag.scss index 10fc161..a604380 100644 --- a/scss/tag.scss +++ b/scss/tag.scss @@ -22,7 +22,6 @@ } .tag { - cursor: pointer; padding: 0.5rem; margin: -0.5rem; border-radius: 8px; diff --git a/templates/page/now.gohtml b/templates/page/now.gohtml index 776e87a..6af668e 100644 --- a/templates/page/now.gohtml +++ b/templates/page/now.gohtml @@ -8,10 +8,12 @@ </div> <div class="tags" style="{{ .Color.GetTagColor }}"> {{ range $tag := .Person.Tags }} - <div class="tag" data-href="{{ .Link }}" title="{{ .Link }}"> + <div class="tag"> <h4>{{ .Name }}</h4> <p>{{ .Description }}</p> - <p><a href="">Hello</a></p> + {{ if and (ne .Link "") (ne .LinkName "") }} + <p><a href="{{ .Link }}">{{ .LinkName }}</a></p> + {{ end }} </div> {{ end }} </div> |
