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

Repeated title annoyance #91

Merged
merged 1 commit into from
Oct 28, 2024

Conversation

rdenadai
Copy link
Contributor

This should fix the bug raised by #84

image

I tryed to leave as a minimal change ... change could be done inside site.rs but was more convoluted given this would need to happen before Tera convert everything to html, but it would be problematic for the content. It would probably need a new property on the Struct just for that.

Closes:

@@ -16,7 +16,7 @@
{%- for content in content_list %}
<article class="content-list-item">
<h2 class="content-title"><a href="./{{content.slug}}.html">{{ content.title | capitalize }}</a></h2>
<p class="content-excerpt">{{ content.html | striptags | truncate(length=100, end="...") }}</p>
<p class="content-excerpt">{{ content.html | striptags | truncate(length=100, end="...") | trim_start_matches(pat=content.title) }}</p>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like it! simple solution that works! thanks

@rochacbruno rochacbruno merged commit 2000649 into rochacbruno:main Oct 28, 2024
1 check passed
@rdenadai
Copy link
Contributor Author

One question here ... Wouldn't be better to grab that description from a property on the .md file? Like title and date right now? And fallback for the content if no description is given?

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

Successfully merging this pull request may close these issues.

2 participants