Twig Components / Methods / shy
Note: You are currently reading the documentation for Bolt 5.0. Looking for the documentation for Bolt 5.2 instead?
shy
(soft hyphenate) is a Twig filter to be used for strings without spaces, that would otherwise break the layout of
your page. By adding these soft hyphens, the browser knows it can wrap to the next line.
For example:
| |
| Before: {{ file }} |
| MyVeryLongFilenameWithoutSpacesOrDashesOrWhatever.jpg |
| |
| After: {{ file|shy }} |
| MyVeryLongFilenameWith- |
| outSpacesOrDashesOrWha- |
| tever.jpg |
| |
Edit this page on GitHub
Couldn't find what you were looking for? We are happy to help you in the forum, on Slack or on Github.
Couldn't find what you were looking for? We are happy to help you in the forum, on Slack or on Github.