add brief text to opengraph description
This commit is contained in:
parent
92b2550865
commit
df450e31ca
@ -47,6 +47,7 @@ type AttachmentModel interface {
|
|||||||
type PostModel interface {
|
type PostModel interface {
|
||||||
BaseModel
|
BaseModel
|
||||||
|
|
||||||
|
Brief() string
|
||||||
CSSClass() string
|
CSSClass() string
|
||||||
FrontendPubkey() string
|
FrontendPubkey() string
|
||||||
MessageID() string
|
MessageID() string
|
||||||
|
@ -305,6 +305,13 @@ func (self *post) Index() int {
|
|||||||
return self.index + 1
|
return self.index + 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (self *post) Brief() string {
|
||||||
|
if len(self.PostMessage) > 140 {
|
||||||
|
return self.PostMessage[:140]
|
||||||
|
}
|
||||||
|
return self.PostMessage
|
||||||
|
}
|
||||||
|
|
||||||
func (self *post) NumImages() int {
|
func (self *post) NumImages() int {
|
||||||
return len(self.Files)
|
return len(self.Files)
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
<meta property="og:site_name" content="changolia" />
|
<meta property="og:site_name" content="changolia" />
|
||||||
<meta property="og:type" content="website"/>
|
<meta property="og:type" content="website"/>
|
||||||
<meta property="og:title" content="{{board.Board}}"/>
|
<meta property="og:title" content="{{board.Board}}"/>
|
||||||
<meta property="og:description" content="thread no. {{thread.OP.PostHash}} on changolia"/>
|
<meta property="og:description" content="{{thread.OP.Brief}}"/>
|
||||||
{{#sfw}}
|
{{#sfw}}
|
||||||
<meta property="og:url" content="{{prefix}}t/{{thread.OP.PostHash}}/?lang={{i18n.Name}}&sfw=1"/>
|
<meta property="og:url" content="{{prefix}}t/{{thread.OP.PostHash}}/?lang={{i18n.Name}}&sfw=1"/>
|
||||||
{{/sfw}}
|
{{/sfw}}
|
||||||
|
Reference in New Issue
Block a user