Closed AlanBell closed 1 year ago
public function generate_the_title(){
$post = $this->post;
return \get_the_title( $post->ID );
}
that appears to be sufficient.
looks to have been dropped in d260d7c276b66ac2c111f0f802370365f8fb4b3c I will update the pull request to put it back as it was
Great catch!
Would this mean every post would automatically be hidden behind the content warning/read more button, though?
Good question! I thought mastodon uses the summary
for that?!?
yeah, mastodon does use the summary for that, so if we put the post title in the summary then pretty much everything will be folded up on Mastodon - however, we should be going back to the spec to see what should be in the field, I think it is here in the activitystreams document that is referenced from the activitypub spec: https://www.w3.org/TR/activitystreams-vocabulary/#dfn-summary so the summary should contain "A natural language summarization of the object encoded as HTML" and putting a blog post title in there seems like a good idea to me. A blog post could be quite big (way over 500 characters) so folding it up in Mastodon with the blog title seems like the polite thing to do.
True for the summary, but the question was more: Does the title have a similar effect for Mastodon? Do you know that?
Regarding the summary: I plan a setting for that, where you can (globally) choose if you want to keep it empty, add am excerpt (maybe choose between title and excerpt) or if you want to add a disclaimer.
@AlanBell @enzocomics any thoughts?
I absolutely agree-- it's a good idea to implement it!
I would argue, however, that the user should be able to choose for themselves whether or not their post is collapsed. It shouldn't be automatic.
I was only able to test this on Mastodon, but I published a post on my site with a very large amount of text to see how Mastodon would handle it:
Only the first 500-or-so characters were initially visible, but clicking on "read more" reveals the entire text, despite it being around 2000 characters long. However, unlike the content warning, it doesn't load the full text inline in the feed -- it loads it in a new column on top of the feed.
I don't know if that's a feature of the protocol, the plugin, or Mastodon itself, though.
For reference, this is what the expanded post looked like:
The read more... is a mastodon UI feature https://github.com/mastodon/mastodon/issues/21047 based on displayed height over 706px.
I think that from Wordpress using the post title as the summary is OK, and using something else as the summary is also OK if the post title then gets prepended to the content. I think using the title as summary is a sensible default, or your first long form article posted without a collapse is going to get you shouted at.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
this line https://github.com/pfefferle/wordpress-activitypub/blob/master/includes/model/class-post.php#L24 sets the summary field of the post (which ends up as a content warning in Mastodon) however I am getting null in the output, which appears to be because there is no generate_the_title function