this post was submitted on 12 Jan 2023
5 points (85.7% liked)

Asklemmy

43394 readers
1413 users here now

A loosely moderated place to ask open-ended questions

Search asklemmy ๐Ÿ”

If your post meets the following criteria, it's welcome here!

  1. Open-ended question
  2. Not offensive: at this point, we do not have the bandwidth to moderate overtly political discussions. Assume best intent and be excellent to each other.
  3. Not regarding using or support for Lemmy: context, see the list of support communities and tools for finding communities below
  4. Not ad nauseam inducing: please make sure it is a question that would be new to most members
  5. An actual topic of discussion

Looking for support?

Looking for a community?

~Icon~ ~by~ ~@Double_A@discuss.tchncs.de~

founded 5 years ago
MODERATORS
 

There have been some requests to make it possible for Mastodon users to create threads on Lemmy. At the moment this is not possible because Mastodon cant set the title field which is mandatory in Lemmy. The same problem affects other projects like Pleroma or Friendica (where title is optional).

It is unlikely that Mastodon would make any change in this regard, so a workaround in Lemmy would be necessary. I implemented such a workaround which makes the title optional when receiving a federated post, and uses the first line of the content instead. This workaround could also be made configurable per instance or per community.

But to be honest I am not sure the workaround is a good idea in general, as it could result in bad titles, and generally more low-quality posts. Thats why I want to know what the community thinks about it.

you are viewing a single comment's thread
view the rest of the comments
[โ€“] 0x1C3B00DA@lemmy.ml 1 points 2 years ago* (last edited 2 years ago) (1 children)

Sure I'll try mocking something up in the browser devtools. On mobile, lemmy displays body text for posts (p.s. I'd like that on desktop too). What I'm talking about is just showing that in the position the title would be, still in an anchor tag so it links to the post but with body text styling instead of in a header.

EDIT: Here's a quick mockup.

The first and third posts are title-less posts and, to me, look good interspersed with titled posts. To get this, I replaced the entire h5 element that serves as the post title with <a class="preview-lines" href="{{post.link}}">{{made up body text}}</a> The preview-lines CSS class applies a visual truncation so even if the text we render is too much it won't overflow.

I don't know how to write Inferno templates but in Vue this would be

<!-- this is the current markup -->
<h5 v-if="post.title">
    <a class="text-body" title="Comments" :href="post.link">
        {{ post.title }}
    </a>
    <button class="btn btn-link text-monospace text-muted small d-inline-block ml-2" data-tippy-content="Expand here">
        <svg class="icon icon-inline">
            <use xlink:href="#icon-plus-square"></use>
            <div class="sr-only"><title>plus-square</title></div>
        </svg>
    </button>
</h5>
<!-- this is new markup i'm suggesting -->
<a v-else class="preview-lines" :href="post.link">
    {{ post.content.substring(0, 250) }}
</a>
[โ€“] nutomic@lemmy.ml 1 points 2 years ago

So you have the same approach of generating a title from the post body. Only you do it on the frontend and not the backend. In Lemmy that might be a bit complicated because the body is already optional, and we would have to somehow encode that either title or body must be set (or both).