feat(data): tags

This commit is contained in:
Anhgelus Morhtuuzh 2024-11-12 17:21:46 +01:00
parent e59feeba35
commit 64c8ae31ff
No known key found for this signature in database
GPG key ID: CAD341EFA92DDDE5
4 changed files with 31 additions and 2 deletions

View file

@ -19,6 +19,12 @@ type Person struct {
Name string `json:"name"` Name string `json:"name"`
Pronouns string `json:"pronouns"` Pronouns string `json:"pronouns"`
Image string `json:"image"` Image string `json:"image"`
Tags []*Tag `json:"tags"`
}
type Tag struct {
Name string `json:"name"`
Description string `json:"description"`
} }
type Color struct { type Color struct {

View file

@ -63,7 +63,14 @@ func main() {
"/credits", "/credits",
"Credits", "Credits",
"", "",
"Credits of the "+cfg.Person.Name+"'s Now page", "Credits of "+cfg.Person.Name+"'s Now page",
&cfg).
Handle()
g.NewTemplate("tags",
"/tags",
"Tags",
"",
"Tags of "+cfg.Person.Name+"'s Now page",
&cfg). &cfg).
Handle() Handle()

View file

@ -9,7 +9,10 @@
<p>{{ .Person.Pronouns }}</p> <p>{{ .Person.Pronouns }}</p>
</div> </div>
</div> </div>
<p class="description">{{ .Description }}</p> <p class="description">
{{ .Description }}
<a href="/tags">More information...</a>
</p>
<div class="links"> <div class="links">
{{ range $link := .Links }} {{ range $link := .Links }}
<div class="link" style="{{ .GetBackground }}"> <div class="link" style="{{ .GetBackground }}">

View file

@ -0,0 +1,13 @@
{{define "body"}}
<main style="{{ .GetBackground }}">
<h2>Tags</h2>
<div class="tags">
{{ range $tag := .Person.Tags }}
<div class="tag">
<h4>{{ .Name }}</h4>
<p>{{ .Description }}</p>
</div>
{{ end }}
</div>
</main>
{{end}}