wordpress-activitypub icon indicating copy to clipboard operation
wordpress-activitypub copied to clipboard

Excerpt doesn't reliably use `the_excerpt` if set

Open mdingemanse opened this issue 2 years ago • 6 comments

Quick summary

Despite my earlier enthusiasm and conviction that [ap_excerpt] uses the_excerpt if you set that, I can't seem to get ActivityPub to reliably recognize the_excerpt even when I tell it to in the settings.

My settings for post content are custom like so:

<p><strong>[ap_title]</strong></p>
[ap_excerpt]
<p>[ap_permalink type="html"]</p>

Example of affected post here: https://ideophone.org/interactive-repair-and-the-foundations-of-language/

The excerpt (set in wordpress, i.e. the_excerpt is visible in the rss at the top of https://ideophone.org/feed/ ; it is:

<description><![CDATA[We have a new paper out in which we argue that the robustness and flexibility of human language is underpinned by a machinery of interactive repair. Repair is normally thought of as a kind of remedial procedure: just one of those things we need because we are only human. But we argue its import is more fundamental. Simply put (and oversimplifying only a bit), we argue we wouldn't have complex language if it weren't for this system of interactive repair. Paper: https://doi.org/10.1016/j.tics.2023.09.003 <a href="https://ideophone.org/interactive-repair-and-the-foundations-of-language/">

But the actual fediverse post by @[email protected] shows up on mastodon as follows, which seems to be the default 400-character truncated version with a "read more" link:

image

Steps to reproduce

  1. create a post, fill out the_excerpt in a way that differs from the post itself
  2. publish it
  3. look at AP output

What you expected to happen

The AP post should use the_excerpt and should not truncate it at 400 characters. It should also not add a "continue reading" link, as he next element in my custom post content is the permalink anyway.

What actually happened

The AP post creates its own excerpt from the first lines of the post and always truncates at 400 characters.

Impact

Most (> 50%)

Available workarounds?

No but the platform is still usable

Logs or notes

No response

mdingemanse avatar Dec 04 '23 15:12 mdingemanse

(I say "doesn't reliably use the_excerpt", because in my earlier testing I did on one occassion manage to get the_excerpt to show up in the post — but I have not been able to reproduce that!)

mdingemanse avatar Dec 04 '23 15:12 mdingemanse

Does your theme maybe use the excerpt_more filter to add the "Continue Reading" link?

I can also try to check tomorrow!

pfefferle avatar Dec 04 '23 19:12 pfefferle

Oh I hadn't thought that a theme might interfere with those settings — will test a different one tomorrow

Out of interest, where 'is' the JSON source grabbed by fedi servers? Because we do see the full excerpt as intended in de RSS feed above

mdingemanse avatar Dec 04 '23 21:12 mdingemanse

Maybe related to #558

kanru avatar Dec 05 '23 14:12 kanru

Confirming that with a different theme (Primer), the excerpts show up (on mastodon) as expected.

I don't suppose there is a way to regenerate them for the few earlier posts that were affected by this?

https://ideophone.org/another-activitypub-test/ (I will be deleting this post)

image

FYI the prior theme was Reddle, not updated in 6 years. Nonetheless there might be other themes that filter excerpt_more for which ActivityPub would not show the expected behaviour.

mdingemanse avatar Dec 06 '23 14:12 mdingemanse

Answering my own question

I don't suppose there is a way to regenerate them for the few earlier posts that were affected by this?

Making a slight change to the excerpt triggers a post edit on the AP side, which is rather neat.

mdingemanse avatar Dec 10 '23 09:12 mdingemanse

This issue is stale because it has been open 120 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] avatar Apr 09 '24 01:04 github-actions[bot]