Add option to set "webmention: false" in post params to not send webmentions

This commit is contained in:
Jan-Lukas Else 2021-07-23 07:02:49 +02:00
parent 3db1f6b85c
commit 18a0bfd15b
1 changed files with 6 additions and 0 deletions

View File

@ -14,6 +14,8 @@ import (
"go.goblog.app/app/pkgs/contenttype"
)
const postParamWebmention = "webmention"
func (a *goBlog) sendWebmentions(p *post) error {
if p.Status != statusPublished && p.Status != statusUnlisted {
// Not published or unlisted
@ -23,6 +25,10 @@ func (a *goBlog) sendWebmentions(p *post) error {
// Just ignore the mentions
return nil
}
if pp, ok := p.Parameters[postParamWebmention]; ok && len(pp) > 0 && pp[0] == "false" {
// Ignore this post
return nil
}
links := []string{}
contentLinks, err := allLinksFromHTML(strings.NewReader(string(a.postHtml(p, false))), a.fullPostURL(p))
if err != nil {