mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-04-08 02:52:39 -05:00
Added support for updating Mentions when Webmentions are resent
refs https://github.com/TryGhost/Team/issues/2535 At the moment we only update the metadata of the Webmention source, so that we can capture update titles, excerpts, etc... when a post is updated.
This commit is contained in:
parent
78bebc6279
commit
3df19235b0
1 changed files with 10 additions and 0 deletions
|
@ -155,6 +155,16 @@ module.exports = class MentionsAPI {
|
|||
let metadata;
|
||||
try {
|
||||
metadata = await this.#webmentionMetadata.fetch(webmention.source);
|
||||
if (mention) {
|
||||
mention.setSourceMetadata({
|
||||
sourceTitle: metadata.title,
|
||||
sourceSiteTitle: metadata.siteTitle,
|
||||
sourceAuthor: metadata.author,
|
||||
sourceExcerpt: metadata.excerpt,
|
||||
sourceFavicon: metadata.favicon,
|
||||
sourceFeaturedImage: metadata.image
|
||||
});
|
||||
}
|
||||
} catch (err) {
|
||||
if (!mention) {
|
||||
throw err;
|
||||
|
|
Loading…
Add table
Reference in a new issue