Releases: matthiasott/webmention
v1.0.4
✨ Enhancement
Eager-loading Webmentions 🎉
This release adds support for eager-loading elements with the following values passed into the with
param:
webmentions
webmentions:<type>
(e.g.webmentions:like
)
{% set entries = craft.entries()
.section('blog')
.with(['webmentions:like', 'webmentions:comment'])
.all() %}
With that in place, calling element.getWebmentions()
or element.getWebmentionsByType()
will return the eager-loaded webmentions, rather than querying for them for each individual element.
New element.getTotalWebmentions()
and getTotalWebmentionsByType()
methods have also been added, which support eager-loading as well.
If all you want to do is output the total, you can set the with
path’s criteria to {count: true}
:
{% set entries = craft.entries()
.section('blog')
.with([
['webmentions:like', {count: true}],
['webmentions:comment', {count: true}],
])
.all() %}
v1.0.3
✨ Enhancements
- Added a new webmention/receive command, which processes the webmention for a given source and target. (#14)
- Improved performance by automatically eager-loading avatars the first time
getAvatar()
is called. (#13) - Added the “Host” condition rule type. (#12)
- “Source” and “Target” condition rules no longer have “has a value” or “is empty” operators. (#12)
authorName
values now use the h-card’snickname
property as a fallback. (#10)
🐞 Bugfixes
- Fixed a bug where webmention validation wasn’t catching
ConnectException
errors. - Fixed a bug where jobs for webmentions whithout a valid backlink to the target got stuck in the queue.
- Fixed a bug where Bluesky source URLs from Brid.gy weren’t always being stored in their entirety. (#11)
v1.0.2
✨ Enhancement
- Fixed a bug where getting the the avatar photo from the parsed representative h-card would fail because the URL was the
value
inside of an array instead of being a string. Now the plugin supports both cases.
v1.0.1
✨ Enhancements
- Added
avatarId
,host
, andproperties
as optional table attributes in the control panel Webmention view - Fixed Bluesky (via Bridgy) avatars: if an avatar image has no extension, the extension is now determined by the respective MIME type
v1.0.0
Webmention for Craft CMS 5. 🎉
Huge thanks to @brandonkelly for basically rewriting the plugin, adding Craft 5 support. 🙏💚
Warning
This update includes breaking changes and requires Craft CMS 5.6.10 or later. Please make sure you’re running at least this version of Craft and perform a database backup before upgrading the plugin.
Note
If you’re updating from Webmention v0.3, follow these instructions.
Changelog
Here’s what’s new:
- Added Craft 5 compatibility.
- Added the “Avatar Location” setting.
- Avatar assets are now accessible via
webmention.avatar
. - Webmentions now store which element they are associated with.
- Added the ability to update webmentions from the control panel.
- Added the
resave/webmentions
CLI command. - Added the
webmention/example-template
CLI command. - Added the
webmention/update
CLI command. - Added the
webmention/update-avatars
CLI command. - Added the
getWebmentions()
andgetWebmentionsByType()
element behaviors - Added support for the Bridgy site types
mastodon
,bluesky
,github
, andreddit
. - Added a new icon based on Paul Robert Lloyd’s IndieWeb icon designs
- Fixed the regex that scans for URLs in entries so that it now correctly handles Markdown links
- Lots of smaller bugfixes and improvements
Updating from v0.3
To update from Webmention 0.3 on Craft 2, do the following after upgrading Craft CMS:
-
Follow the installation instructions.
-
Go to Settings → Webmention and select the volume that avatars are stored in, from the Avatar Location setting.
-
Run the following CLI command to update your existing webmentions’ avatar relations:
php craft webmention/update-avatars
-
Run the following CLI command to update search indexes for existing webmentions:
php craft resave/webmentions --update-search-index
-
Update your templates based on the following changes:
Old New webmention.author_name
webmention.authorName
webmention.author_url
webmention.authorUrl
webmention.author_photo
webmention.avatar.getUrl()
webmention.url
webmention.hEntryUrl
webmention.site
webmention.host
craft.webmention.getAllWebmentionsForEntry(craft.request.url)
craft.webmention.getWebmentions()
craft.webmention.showWebmentions(craft.request.url)
craft.webmention.showWebmentions()
craft.webmention.webmentionForm(craft.request.url)
craft.webmention.webmentionForm()
Note
If you have any webmentions which contain double-encoded HTML entities, you can update them via the “Update” action in the UI, or with the following command:
php craft webmention/update --webmention-id=123
0.3.1
- Changed the retrieval method for links within an entry to fix a bug where a very long article with many links would lead to a PHP execution timeout
- Minor bugfixes and improvements
0.3.0
- Webmention sending functionality implemented
- Setting added: Entry Types (for Webmention sending)
- New “Webmention Switch” field type
0.2.0
- Webmentions are now stored as Craft elements (ElementType:
Webmention_webmention
) - Improved backend functionality: Webmentions are displayed under the tab Webmentions and can be deleted
- The plugin now sets the
type
property of an incoming Webmention correctly, based on the Microformats propertiesu-like-of
,u-like
,u-repost-of
, andu-repost
.
0.1.0
First version