Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR HTML

strip newlines in jekyll

{% assign description = page.excerpt | newline_to_br | strip_newlines | replace: '<br />', ' ' | strip_html | strip |  truncatewords: 30 %}

<meta name="description" content="{{ description }}">
Replace newlines with br tag, then strip newlines, and then replace <br /> with space. Strip html and truncate for usage in meta description.
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #strip #newlines #jekyll
ADD COMMENT
Topic
Name
8+4 =