Skip to content

Commit

Permalink
Fixes problem if "excerpt" is blank (#31)
Browse files Browse the repository at this point in the history
Fixes problem where if "excerpt" is blank, the first 160 characters of "content" are not displayed. This is related to "Null Coalescence doesn't return fallback if falsey variable uses a modifier #2022" issue located at statamic/cms#2022
  • Loading branch information
cnc137 authored Feb 22, 2021
1 parent 3e71b15 commit 2a58653
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion resources/views/home.antlers.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ <h2 class="mb-4">
</h2>
<p class="text-gray-600">
<span class="text-gray-800 text-sm uppercase tracking-widest font-medium">{{ date }}</span> &mdash;
{{ excerpt | widont ?? content | strip_tags | safe_truncate:160:...}}
{{ excerpt ? excerpt | widont : content | strip_tags | safe_truncate:160:...}}
</p>
</div>
{{ /articles }}
Expand Down

0 comments on commit 2a58653

Please sign in to comment.