From 85cec76445489b00562c8acd9a1319003b705927 Mon Sep 17 00:00:00 2001 From: Gabe Kangas Date: Tue, 30 Jun 2020 17:11:24 -0700 Subject: [PATCH] Move around how SocialHandles are configured. Closes #30 --- config-example.yaml | 17 +++++++++++------ config/config.go | 7 ++++++- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/config-example.yaml b/config-example.yaml index 34ba8b91e..c47043970 100644 --- a/config-example.yaml +++ b/config-example.yaml @@ -6,7 +6,7 @@ webServerPort: 8080 instanceDetails: name: Owncast title: Owncast Demo Server - summary: "This is brief summary of whom you are or what your stream is. demo server for Owncast. You can read more about it at owncast.online. You can edit this description in your web config file.\n\nBlathers is an owl with brown feathers. His face is white and he has a yellow beak. His arms are wing shaped and he has yellow talons. His eyes are very big with small black irises. He also has big pink cheek circles on his cheeks. His belly appears to be checkered in diamonds with light brown and white squares, similar to an argyle vest, which is traditionally associated with academia. His green bowtie further alludes to his academic nature." + summary: "This is brief summary of whom you are or what your stream is. You can read more about it at owncast.online. You can edit this description in your config file." extraUserInfoFileName: "/static/content.md" logo: @@ -20,11 +20,16 @@ instanceDetails: # See documentation for full list of supported social links. All optional. socialHandles: - twitter: http://twitter.com/owncast - instagram: http://instagram.biz/owncast - facebook: http://facebook.gov/owncast - tiktok: http://tiktok.cn/owncast - soundcloud: http://soundcloud.com/owncast + - platform: twitter + url: http://twitter.com/owncast + - platform: instagram + url: http://instagram.biz/owncast + - platform: facebook + url: http://facebook.gov/owncast + - platform: tiktok + url: http://tiktok.cn/owncast + - platform: soundcloud + url: http://soundcloud.com/owncast videoSettings: chunkLengthInSeconds: 4 diff --git a/config/config.go b/config/config.go index e4d8c151f..fa16cd8cb 100644 --- a/config/config.go +++ b/config/config.go @@ -33,10 +33,15 @@ type InstanceDetails struct { Summary string `yaml:"summary" json:"summary"` Logo map[string]string `yaml:"logo" json:"logo"` Tags []string `yaml:"tags" json:"tags"` - SocialHandles map[string]string `yaml:"socialHandles" json:"socialHandles"` + SocialHandles []socialHandle `yaml:"socialHandles" json:"socialHandles"` ExtraInfoFile string `yaml:"extraUserInfoFileName" json:"extraUserInfoFileName"` } +type socialHandle struct { + Platform string `yaml:"platform" json:"platform"` + URL string `yaml:"url" json:"url"` +} + type videoSettings struct { ChunkLengthInSeconds int `yaml:"chunkLengthInSeconds"` StreamingKey string `yaml:"streamingKey"`