From a10827cd504e0ee2eeb27d3165a382d4b57c644a Mon Sep 17 00:00:00 2001 From: Matt Baer Date: Tue, 23 Feb 2021 17:36:35 -0500 Subject: [PATCH 1/2] Hide post signature on pinned posts Ref T814 --- postrender.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/postrender.go b/postrender.go index ccfc565..b9ef07c 100644 --- a/postrender.go +++ b/postrender.go @@ -60,6 +60,10 @@ func (p *PublicPost) formatContent(cfg *config.Config, isOwner bool) { } func (p *Post) augmentContent(c *Collection) { + if p.PinnedPosition.Valid { + // Don't augment posts that are pinned + return + } // Add post signatures if c.Signature != "" { p.Content += "\n\n" + c.Signature From 33cf9263f54c99801920d3459fd17adcb6106848 Mon Sep 17 00:00:00 2001 From: Matt Baer Date: Wed, 24 Feb 2021 12:49:28 -0500 Subject: [PATCH 2/2] Support "nosig" shortcode to hide signature in post If a post contains anywhere in the body, the post will render without a post signature on it. Ref T815 --- postrender.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/postrender.go b/postrender.go index b9ef07c..12c4a81 100644 --- a/postrender.go +++ b/postrender.go @@ -64,6 +64,10 @@ func (p *Post) augmentContent(c *Collection) { // Don't augment posts that are pinned return } + if strings.Index(p.Content, "") > -1 { + // Don't augment posts with the special "nosig" shortcode + return + } // Add post signatures if c.Signature != "" { p.Content += "\n\n" + c.Signature