From df450e31cac0013eae8a25493bc802e770d6887d Mon Sep 17 00:00:00 2001 From: Jeff Date: Sat, 25 Aug 2018 15:44:37 -0400 Subject: [PATCH 1/3] add brief text to opengraph description --- contrib/backends/srndv2/src/srnd/model.go | 1 + contrib/backends/srndv2/src/srnd/model_mem.go | 7 +++++++ contrib/templates/placebo/thread.mustache | 2 +- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/contrib/backends/srndv2/src/srnd/model.go b/contrib/backends/srndv2/src/srnd/model.go index 30eee2f..a177f85 100644 --- a/contrib/backends/srndv2/src/srnd/model.go +++ b/contrib/backends/srndv2/src/srnd/model.go @@ -47,6 +47,7 @@ type AttachmentModel interface { type PostModel interface { BaseModel + Brief() string CSSClass() string FrontendPubkey() string MessageID() string diff --git a/contrib/backends/srndv2/src/srnd/model_mem.go b/contrib/backends/srndv2/src/srnd/model_mem.go index 6a09ae5..37ebfcd 100644 --- a/contrib/backends/srndv2/src/srnd/model_mem.go +++ b/contrib/backends/srndv2/src/srnd/model_mem.go @@ -305,6 +305,13 @@ func (self *post) Index() int { 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 { return len(self.Files) } diff --git a/contrib/templates/placebo/thread.mustache b/contrib/templates/placebo/thread.mustache index c9b4766..2bab407 100644 --- a/contrib/templates/placebo/thread.mustache +++ b/contrib/templates/placebo/thread.mustache @@ -24,7 +24,7 @@ - + {{#sfw}} {{/sfw}} From 4a02015f8e3037188a50658abc7d74d883873f06 Mon Sep 17 00:00:00 2001 From: Jeff Date: Sat, 25 Aug 2018 15:47:22 -0400 Subject: [PATCH 2/3] og attachments --- contrib/templates/placebo/thread.mustache | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/contrib/templates/placebo/thread.mustache b/contrib/templates/placebo/thread.mustache index 2bab407..ab6e06e 100644 --- a/contrib/templates/placebo/thread.mustache +++ b/contrib/templates/placebo/thread.mustache @@ -31,9 +31,10 @@ {{^sfw}} {{/sfw}} - - + {{#thread.OP.Attachments}} + + {{/thread.OP.Attachments}} + {{{thread.Navbar}}}
From 468320706ca4152a18631a519a5f8b0552b71755 Mon Sep 17 00:00:00 2001 From: Jeff Date: Sat, 25 Aug 2018 15:49:41 -0400 Subject: [PATCH 3/3] fix typo --- contrib/templates/placebo/thread.mustache | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/templates/placebo/thread.mustache b/contrib/templates/placebo/thread.mustache index ab6e06e..34e6ebb 100644 --- a/contrib/templates/placebo/thread.mustache +++ b/contrib/templates/placebo/thread.mustache @@ -32,7 +32,7 @@ {{/sfw}} {{#thread.OP.Attachments}} - + {{/thread.OP.Attachments}}