Skip to content

Commit

Permalink
Use variable-length text for events-list to highlight image-alignment…
Browse files Browse the repository at this point in the history
… bug.
  • Loading branch information
adamfranco committed Oct 7, 2020
1 parent 892eb5d commit f56c094
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/templates/partials/event-teaser.twig
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,16 @@
</h3>
<time datetime="" class="d-block font-medium">11:45 AM</time>
<p class="f3 my-3">
{% set max_length = (i * 30) + 20 %}
{% set text =
'Lorem ipsum dolor sit amet, consectetur adipisicing elit. Amet
asperiores illum quas, voluptatum atque voluptas, animi ipsam magni sit
quo quae ut fugit. Accusantium explicabo sunt laborum? Soluta, placeat
nisi.'
%}
{# naive example of truncate event text to 100 #}
{{ (text|striptags|length) > 100
? (text|striptags|slice(0, 100)) ~ '...'
{{ (text|striptags|length) > max_length
? (text|striptags|slice(0, max_length)) ~ '...'
: text|striptags }}
</p>
<p class="f3 font-medium">
Expand Down

1 comment on commit f56c094

@adamfranco
Copy link
Member Author

Choose a reason for hiding this comment

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

This is for #355

Please sign in to comment.