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

Show a teaser on the blog listing page. #491

Open
3 tasks done
JoshOrndorff opened this issue Feb 17, 2025 · 3 comments
Open
3 tasks done

Show a teaser on the blog listing page. #491

JoshOrndorff opened this issue Feb 17, 2025 · 3 comments
Labels
enhancement New feature or request

Comments

@JoshOrndorff
Copy link

Summary and motivation

I would like my blog listing page to show a "teaser" of the content in the post. It could be as simple as the first 300 characters or something like that.

I didn't see a way to do this with current tabi settings.

I can make my site look the say I want by copying the first 300 characters into the description in the frontmatter, but I prefer not to duplicate the content.

Implementation details

No response

Checklist

  • I've searched existing issues to make sure this feature hasn't already been requested.
  • This feature aligns with tabi's philosophy (minimal JS, accessible…)
  • I'm willing to contribute to the implementation of this feature.
@JoshOrndorff JoshOrndorff added the enhancement New feature or request label Feb 17, 2025
@welpo
Copy link
Owner

welpo commented Feb 17, 2025

Hi @JoshOrndorff!

I don't think it's documented anywhere (I should fix this), but tabi is compatible with Zola's summary feature.

This means you can do this:

Actual text of your post…
<!-- more -->

And it will include everything up to the <!-- more --> tag on the post's listing.

Give it a try and let me know if that's what you wanted!

@JoshOrndorff
Copy link
Author

Thank you for pointing out the summary feature. I was not aware of that. This is a big step in the right direction. But one little bit remains.

My site has a type of post that are micro blogs: usually only a sentence or two long, few hundred characters max. For these micro blogs, the summary should typically be the entire content. This can be achieved by having content creators put a <!-- more --> at the very end of the content.

However this could easily be forgotten and is an annoyance even when one remembers. Can I have the summary default to the full content (rather than empty) when no summary break is explicitly set?

@welpo
Copy link
Owner

welpo commented Feb 18, 2025

That is something that I considered while replying to you.

I've seen some sites using tabi with empty descriptions (no description and no summary). It feels a bit empty.

We could take the first n characters of the post, truncate (preferably not mid-word, not sure this is possible, specially considering some languages like Japanese don't use spaces), and append

This shouldn't be too hard to implement. We'd need to use it consistently though (e.g. include atom.xml template). And perhaps add a config option to enable/disable this. I'd lean towards enabling it by default and marking the change as breaking, but I'd like to see it in action first.

Would you be interested in working on this feature? I'd be happy to provide assistance in any way (review/complete the PR, answer questions…).

Let me know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants