Closed campegg closed 7 months ago
Good suggestion - might be useful to go more general and allow either an include or exclude list and a class to override that.
Will include this soon.
Included in 4.1.1: release notes.
WEBMENTIONS_DOMAINS_INCOMING_ALLOW: Iterable[str] = None
WEBMENTIONS_DOMAINS_INCOMING_DENY: Iterable[str] = None
WEBMENTIONS_DOMAINS_OUTGOING_ALLOW: Iterable[str] = None
WEBMENTIONS_DOMAINS_OUTGOING_DENY: Iterable[str] = None
WEBMENTIONS_DOMAINS_OUTGOING_TAG_ALLOW: str = None
WEBMENTIONS_DOMAINS_OUTGOING_TAG_DENY: str = None
Sample settings:
WEBMENTIONS_DOMAINS_OUTGOING_DENY = [
"domain1.com",
"sub.domain2.com",
"*.domain3.com", # Also include any subdomain
]
WEBMENTIONS_DOMAINS_OUTGOING_TAG_DENY: str = "wm-nosend"
Override tag can be included as a class, data attribute or custom attribute:
<a class="wm-nosend" href="...">link text</a>
<a data-wm-nosend href="...">link text</a>
<a wm-nosend href="...">link text</a>
Let me know if you have any issues!
This is brilliant—thank you!
Not at all critical, but there are times when I have multiple links in a post and know that some of the sites don't accept webmentions. It would be cool if there was a way to exclude outgoing webmentions from being sent to those domains that are known not to accept them to stop them from clogging up the admin. I could see this being done either as a setting (e.g.):
WEBMENTIONS_EXCLUDE_DOMAINS = ["domain1.com", "domain2.com"]
…or even as a class added to a link on a case-by-case basis (e.g.):
<a class="wm-nosend" href="https://domain.com/page.html">link text</a>