Sharing: Set siteUrl to shared content #18

Signed-off-by: Michael Mayer <michael@liquidbytes.net>
This commit is contained in:
Michael Mayer 2020-06-27 17:39:53 +02:00
parent 957638e0df
commit c07f657c06
4 changed files with 6 additions and 1 deletions

View file

@ -8,6 +8,7 @@
<title>{{ .config.SiteTitle }}</title>
<meta property="og:url" content="{{ .config.SiteUrl }}"/>
<meta property="og:type" content="website" />
<meta property="og:title" content="{{ .config.SiteTitle }}{{if .config.SiteCaption}}: {{ .config.SiteCaption }}{{end}}"/>
<meta property="og:image" content="{{ .config.SitePreview }}"/>
<meta property="og:description" content="{{ .config.SiteDescription }}"/>

View file

@ -8,6 +8,7 @@
<title>{{ .config.SiteTitle }}{{if .config.SiteCaption}}: {{ .config.SiteCaption }}{{end}}</title>
<meta property="og:url" content="{{ .config.SiteUrl }}"/>
<meta property="og:type" content="website" />
<meta property="og:title" content="{{ .config.SiteCaption }}"/>
<meta property="og:image" content="{{ .config.SitePreview }}"/>
<meta property="og:description" content="{{ .config.SiteDescription }}"/>

View file

@ -8,6 +8,7 @@
<title>{{ .config.SiteTitle }}</title>
<meta property="og:url" content="{{ .config.SiteUrl }}"/>
<meta property="og:type" content="website" />
<meta property="og:title" content="{{ .config.SiteTitle }}{{if .config.SiteCaption}}: {{ .config.SiteCaption }}{{end}}"/>
<meta property="og:image" content="{{ .config.SitePreview }}"/>
<meta property="og:description" content="{{ .config.SiteDescription }}"/>

View file

@ -26,6 +26,7 @@ func Shares(router *gin.RouterGroup) {
}
clientConfig := conf.GuestConfig()
clientConfig.SiteUrl = fmt.Sprintf("%ss/%s", clientConfig.SiteUrl, shareToken)
c.HTML(http.StatusOK, "share.tmpl", gin.H{"config": clientConfig})
})
@ -52,7 +53,8 @@ func Shares(router *gin.RouterGroup) {
}
clientConfig := conf.GuestConfig()
clientConfig.SitePreview = fmt.Sprintf("%ss/%s/%s/preview", clientConfig.SiteUrl, shareToken, uid)
clientConfig.SiteUrl = fmt.Sprintf("%ss/%s/%s", clientConfig.SiteUrl, shareToken, uid)
clientConfig.SitePreview = fmt.Sprintf("%s/preview", clientConfig.SiteUrl)
if a, err := query.AlbumByUID(uid); err == nil {
clientConfig.SiteCaption = a.AlbumTitle