Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

generate_the_title function doesn't appear to exist #191

Closed
AlanBell opened this issue Nov 20, 2022 · 9 comments
Closed

generate_the_title function doesn't appear to exist #191

AlanBell opened this issue Nov 20, 2022 · 9 comments
Labels
[Status] wontfix This will not be worked on

Comments

@AlanBell
Copy link

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

@AlanBell
Copy link
Author

        public function generate_the_title(){
                $post = $this->post;
                return \get_the_title( $post->ID );
        }

that appears to be sufficient.

AlanBell added a commit to AlanBell/wordpress-activitypub that referenced this issue Nov 23, 2022
fix Automattic#191 by implementing a function to get the title, which becomes the ActivityPub summary/subject/content warning field.
@AlanBell
Copy link
Author

looks to have been dropped in d260d7c I will update the pull request to put it back as it was

@enzocomics
Copy link

Great catch!

Would this mean every post would automatically be hidden behind the content warning/read more button, though?

image

@pfefferle
Copy link
Member

Good question! I thought mastodon uses the summary for that?!?

@AlanBell
Copy link
Author

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.

@pfefferle
Copy link
Member

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?

@enzocomics
Copy link

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:

Screenshot 2022-11-24 004128

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:

Screenshot 2022-11-24 005023

@AlanBell
Copy link
Author

The read more... is a mastodon UI feature mastodon/mastodon#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.

@stale
Copy link

stale bot commented Mar 24, 2023

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.

@stale stale bot added the [Status] wontfix This will not be worked on label Mar 24, 2023
@stale stale bot closed this as completed Mar 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Status] wontfix This will not be worked on
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants