Skip to content

Commit

Permalink
use cond to enable 0 length
Browse files Browse the repository at this point in the history
  • Loading branch information
Olivia206 committed Sep 16, 2024
1 parent 7a561fb commit 553054e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion layouts/partials/GetTruncateContent
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{ $length := .length | default 150 }}
{{ $length := cond (eq .length 0) 0 (default 150 .length) }}
{{ $text := .text }}

{{ if gt $length 0 }}
Expand Down

0 comments on commit 553054e

Please sign in to comment.