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