mirror of
https://github.com/aykhans/slash-e.git
synced 2025-06-14 03:47:50 +00:00
chore: upgrader to 0.5.1
This commit is contained in:
@ -133,15 +133,25 @@ Sitemap: %s/sitemap.xml`, instanceURL, instanceURL)
|
||||
}
|
||||
|
||||
func generateShortcutMetadata(shortcut *storepb.Shortcut) string {
|
||||
title, description := shortcut.Title, shortcut.Description
|
||||
if shortcut.OgMetadata != nil {
|
||||
if shortcut.OgMetadata.Title != "" {
|
||||
title = shortcut.OgMetadata.Title
|
||||
}
|
||||
if shortcut.OgMetadata.Description != "" {
|
||||
description = shortcut.OgMetadata.Description
|
||||
}
|
||||
}
|
||||
|
||||
metadataList := []string{
|
||||
fmt.Sprintf(`<meta name="description" content="%s" />`, template.HTMLEscapeString(shortcut.OgMetadata.Description)),
|
||||
fmt.Sprintf(`<meta property="og:title" content="%s" />`, template.HTMLEscapeString(shortcut.OgMetadata.Title)),
|
||||
fmt.Sprintf(`<meta property="og:description" content="%s" />`, template.HTMLEscapeString(shortcut.OgMetadata.Description)),
|
||||
fmt.Sprintf(`<meta name="description" content="%s" />`, template.HTMLEscapeString(description)),
|
||||
fmt.Sprintf(`<meta property="og:title" content="%s" />`, template.HTMLEscapeString(title)),
|
||||
fmt.Sprintf(`<meta property="og:description" content="%s" />`, template.HTMLEscapeString(description)),
|
||||
fmt.Sprintf(`<meta property="og:image" content="%s" />`, template.HTMLEscapeString(shortcut.OgMetadata.Image)),
|
||||
`<meta property="og:type" content="website" />`,
|
||||
// Twitter related metadata.
|
||||
fmt.Sprintf(`<meta name="twitter:title" content="%s" />`, template.HTMLEscapeString(shortcut.OgMetadata.Title)),
|
||||
fmt.Sprintf(`<meta name="twitter:description" content="%s" />`, template.HTMLEscapeString(shortcut.OgMetadata.Description)),
|
||||
fmt.Sprintf(`<meta name="twitter:title" content="%s" />`, template.HTMLEscapeString(title)),
|
||||
fmt.Sprintf(`<meta name="twitter:description" content="%s" />`, template.HTMLEscapeString(description)),
|
||||
fmt.Sprintf(`<meta name="twitter:image" content="%s" />`, template.HTMLEscapeString(shortcut.OgMetadata.Image)),
|
||||
`<meta name="twitter:card" content="summary_large_image" />`,
|
||||
fmt.Sprintf(`<meta property="og:url" content="%s" />`, template.HTMLEscapeString(shortcut.Link)),
|
||||
|
@ -9,7 +9,7 @@ import (
|
||||
|
||||
// Version is the service current released version.
|
||||
// Semantic versioning: https://semver.org/
|
||||
var Version = "0.5.0"
|
||||
var Version = "0.5.1"
|
||||
|
||||
// DevVersion is the service current development version.
|
||||
var DevVersion = "0.5.1"
|
||||
|
Reference in New Issue
Block a user