From 64c8ae31ff131e9d1071abeda55a1c1cb2bf5125 Mon Sep 17 00:00:00 2001 From: Anhgelus Morhtuuzh Date: Tue, 12 Nov 2024 17:21:46 +0100 Subject: [PATCH] feat(data): tags --- data.go | 6 ++++++ main.go | 9 ++++++++- templates/page/index.gohtml | 5 ++++- templates/page/tags.gohtml | 13 +++++++++++++ 4 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 templates/page/tags.gohtml diff --git a/data.go b/data.go index 2b755bb..c4f9354 100644 --- a/data.go +++ b/data.go @@ -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 { diff --git a/main.go b/main.go index c040fbc..897bc57 100644 --- a/main.go +++ b/main.go @@ -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 @@

{{ .Person.Pronouns }}

-

{{ .Description }}

+

+ {{ .Description }} + More information... +