feat(data): tags
This commit is contained in:
parent
e59feeba35
commit
64c8ae31ff
4 changed files with 31 additions and 2 deletions
6
data.go
6
data.go
|
@ -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 {
|
||||||
|
|
9
main.go
9
main.go
|
@ -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()
|
||||||
|
|
||||||
|
|
|
@ -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 }}">
|
||||||
|
|
13
templates/page/tags.gohtml
Normal file
13
templates/page/tags.gohtml
Normal 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}}
|
Loading…
Add table
Add a link
Reference in a new issue