Skip to content

Repeated title annoyance#91

Merged
rochacbruno merged 1 commit intorochacbruno:mainfrom
rdenadai:repeated-title-annoyance
Oct 28, 2024
Merged

Repeated title annoyance#91
rochacbruno merged 1 commit intorochacbruno:mainfrom
rdenadai:repeated-title-annoyance

Conversation

@rdenadai
Copy link
Copy Markdown
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:

<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
Copy Markdown
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
@rdenadai
Copy link
Copy Markdown
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