feat(dashboard): add default opengraph embed tags

This commit is contained in:
spiral 2022-06-05 11:33:09 -04:00
parent 7f816f50f7
commit 0e1b5c5e02
No known key found for this signature in database
GPG Key ID: 244A11E4B0BCF40E

View File

@ -25,6 +25,8 @@ var baseURL = "https://api.pluralkit.me/v2"
var version = "dev"
const defaultEmbed = `<meta property="og:title" content="PluralKit | web dashboard" /> <meta name="theme-color" content="#da9317">`
func main() {
r := chi.NewRouter()
@ -66,7 +68,7 @@ func notFoundHandler(rw http.ResponseWriter, r *http.Request) {
} else {
data, err = fs.ReadFile("dist/index.html")
rw.Header().Add("content-type", "text/html")
data = []byte(strings.Replace(string(data), `<!-- extra data -->`, "", 1))
data = []byte(strings.Replace(string(data), `<!-- extra data -->`, defaultEmbed, 1))
}
if err != nil {