{{ $summary := replace (.Summary | truncate 100) "..." "" }}
When I use truncate 100, it adds 3 periods (…) at the end of the text after 100 characters.
I want to remove this, I tried with the code above but it doesn’t work.
Can you help me?
{{ $summary := replace (.Summary | truncate 100) "..." "" }}
When I use truncate 100, it adds 3 periods (…) at the end of the text after 100 characters.
I want to remove this, I tried with the code above but it doesn’t work.
Can you help me?
By default truncate
add a ellipsis “…” not three separate dots “…”
You can set it to anything you like, including an empty string like this.
{{ $summary := (.Summary | truncate 100 "") }}
See the documentation at:
{{ $summary := (.Summary | truncate 100 "") }}
It worked, thank you.
This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.