Archived
1
0

Merge branch 'master' of ssh://github.com/majestrate/nntpchan

This commit is contained in:
Jeff Becker 2018-09-02 07:17:25 -04:00
commit 91ced83c3a
No known key found for this signature in database
GPG Key ID: F357B3B42F6F9B05
3 changed files with 13 additions and 4 deletions

View File

@ -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

View File

@ -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)
} }

View File

@ -24,15 +24,16 @@
<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}}
{{^sfw}} {{^sfw}}
<meta property="og:url" content="{{prefix}}t/{{thread.OP.PostHash}}/?lang={{i18n.Name}}"/> <meta property="og:url" content="{{prefix}}t/{{thread.OP.PostHash}}/?lang={{i18n.Name}}"/>
{{/sfw}} {{/sfw}}
<meta property="og:image" {{#thread.OP.Attachments}}
content="{{prefix}}static/changolia-logo.png"/> <meta property="og:image" content="{{Thumbnail}}" />
{{/thread.OP.Attachments}}
</head> </head>
<body class="threadpage"> <body class="threadpage">
{{{thread.Navbar}}} {{{thread.Navbar}}}