Set limit for posts subtitle #987
Labels
No labels
A: API
A: Backend
A: Federation
A: Front-End
A: I18N
A: Meta
A: Security
Build
C: Bug
C: Discussion
C: Enhancement
C: Feature
Compatibility
Dependency
Design
Documentation
Good first issue
Help welcome
Mobile
Rendering
S: Blocked
S: Duplicate
S: Incomplete
S: Instance specific
S: Invalid
S: Needs Voting/Discussion
S: Ready for review
Suggestion
S: Voted on Loomio
S: Wontfix
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: Plume/Plume#987
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
some users write all of the post's content in subtitle part and it's awfull!
Please set a limit for subtitle.
I think 154 is standard for SEO. Because it use as description in meta tags.
Thanks!
You're right. We will implement.
Thank you!
This might occur because it's hard to distinguish subtitle area and content area in rich text editor. If so, we should fix rich text editor.
A first way would be to add
.truncate(154)on this functionfn get_subtitle() -> String {So that it becomes:
Using https://doc.rust-lang.org/std/string/struct.String.html#method.truncate .
But then, this magic value of 154 has to be defined in some other file, in order to be easily modifiable.
I'm not familiar with Rust way of having a huge file with many useful constants, but maybe the lib.rs file could be a good one, where we put some:
Then we just have to import it and use it in place of 154.
Near 500 characters might be good because Mastodon shows subtitle and it shows at most 500 characters.
I found the same issue: #627