mirror of https://github.com/jlelse/GoBlog
Add option to set "webmention: false" in post params to not send webmentions
This commit is contained in:
parent
3db1f6b85c
commit
18a0bfd15b
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue