diff --git a/README.md b/README.md index 74f80e0..383372f 100644 --- a/README.md +++ b/README.md @@ -21,18 +21,21 @@ This font must be compressed by [Woff2](https://en.wikipedia.org/wiki/Web_Open_F ### Main config You can create a sample config with the flag `-generate-json-config` (which generates a JSON config) or with `-generate-toml-config` (which generates a TOML config). -A JSON schema is available for json configs. +A JSON schema is available for JSON configs. The config does not depend on the markup language: a field `foo` will being named `foo` for JSON and TOML. The TOML format is used in this section. -The root is defining the background image, the description, the file's path to the legal pages and the path to -the configs of custom pages. +The root is defining the background image, the description, the file's path to the legal pages, the path to +the configs of custom pages and a list of all your ["rel-me"](https://microformats.org/wiki/rel-me) links. +(The "rel-me" links are required to +[verify a link on your Mastodon account](https://docs.joinmastodon.org/user/profile/#verification), for example.) ```toml image = "wallpaper.webp" description = "I am a beautiful description!" legal = "legal.html" custom_pages = ["custom.toml"] +rel_me_links = ["https://foo.example.org/@bar"] ``` The path is relative to the execution of the binary. If you are using Docker, please use a static path. diff --git a/config.schema.json b/config.schema.json index 2e8a7c1..f2a2600 100644 --- a/config.schema.json +++ b/config.schema.json @@ -160,6 +160,9 @@ }, "custom_pages": { "type": "array" + }, + "rel_me_links": { + "type": "array" } }, "additionalProperties": false, diff --git a/data.go b/data.go index de58d99..75ec2d0 100644 --- a/data.go +++ b/data.go @@ -11,15 +11,6 @@ import ( "strings" ) -const ( - TitleContentType = "title" - SubtitleContentType = "subtitle" - ParagraphContentType = "paragraph" - ListContentType = "list" - OrderedListContentType = "ordered_list" - ButtonsContentType = "links" -) - type ConfigData interface { GetTextColor() template.CSS GetBackground() template.CSS @@ -34,6 +25,7 @@ type Config struct { Color *Color `json:"colors" toml:"colors"` Links []*Link `json:"links" toml:"links"` Legal string `json:"legal" toml:"legal"` + RelMeLinks []string `json:"rel_me_links" toml:"rel_me_links"` CustomPages []string `json:"custom_pages" toml:"custom_pages"` } diff --git a/main.go b/main.go index bf5905e..14432a1 100644 --- a/main.go +++ b/main.go @@ -174,6 +174,7 @@ func generateConfigFile(isToml bool) { }, Legal: "legal.html", CustomPages: []string{"custom.json"}, + RelMeLinks: []string{"https://foo.example.org/@bar"}, } var b []byte var err error diff --git a/templates/base/base.gohtml b/templates/base/base.gohtml index 3b1e37c..a740970 100644 --- a/templates/base/base.gohtml +++ b/templates/base/base.gohtml @@ -13,6 +13,9 @@ .links { {{ .Data.Color.Button.GetBackground }}{{ .Data.Color.Button.GetTextColor }} } {{ end }} + {{ range .Data.RelMeLinks }} + + {{ end }}