diff options
| -rw-r--r-- | data.go | 6 | ||||
| -rw-r--r-- | main.go | 9 | ||||
| -rw-r--r-- | templates/page/index.gohtml | 5 | ||||
| -rw-r--r-- | templates/page/tags.gohtml | 13 |
4 files changed, 31 insertions, 2 deletions
@@ -19,6 +19,12 @@ type Person struct { Name string `json:"name"` Pronouns string `json:"pronouns"` Image string `json:"image"` + Tags []*Tag `json:"tags"` +} + +type Tag struct { + Name string `json:"name"` + Description string `json:"description"` } type Color struct { @@ -63,7 +63,14 @@ func main() { "/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). Handle() diff --git a/templates/page/index.gohtml b/templates/page/index.gohtml index fccb7a5..b3139a3 100644 --- a/templates/page/index.gohtml +++ b/templates/page/index.gohtml @@ -9,7 +9,10 @@ <p>{{ .Person.Pronouns }}</p> </div> </div> - <p class="description">{{ .Description }}</p> + <p class="description"> + {{ .Description }} + <a href="/tags">More information...</a> + </p> <div class="links"> {{ range $link := .Links }} <div class="link" style="{{ .GetBackground }}"> diff --git a/templates/page/tags.gohtml b/templates/page/tags.gohtml new file mode 100644 index 0000000..dc13916 --- /dev/null +++ b/templates/page/tags.gohtml @@ -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}}
\ No newline at end of file |
