2018-11-06 18:14:13 +00:00
|
|
|
package post
|
|
|
|
|
|
|
|
import (
|
2019-06-03 09:32:43 +00:00
|
|
|
"github.com/animenotifier/notify.moe/arn"
|
2019-06-01 04:55:49 +00:00
|
|
|
"github.com/animenotifier/notify.moe/assets"
|
2018-11-06 18:14:13 +00:00
|
|
|
"github.com/animenotifier/notify.moe/utils"
|
|
|
|
)
|
|
|
|
|
2019-06-05 07:18:04 +00:00
|
|
|
func getOpenGraph(post *arn.Post) *arn.OpenGraph {
|
2018-11-06 18:14:13 +00:00
|
|
|
openGraph := &arn.OpenGraph{
|
|
|
|
Tags: map[string]string{
|
|
|
|
"og:title": post.TitleByUser(nil),
|
|
|
|
"og:description": utils.CutLongDescription(post.Text),
|
2019-06-01 04:55:49 +00:00
|
|
|
"og:url": "https://" + assets.Domain + post.Link(),
|
|
|
|
"og:site_name": assets.Domain,
|
2018-11-06 18:14:13 +00:00
|
|
|
"og:type": "article",
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
return openGraph
|
|
|
|
}
|