fix: truncation

This commit is contained in:
Cory Dransfeldt 2024-10-15 17:50:16 -07:00
parent c04c69fcbd
commit 7fb22f6d62
No known key found for this signature in database
7 changed files with 116 additions and 554 deletions

View file

@ -32,15 +32,15 @@
{%- if schema == 'blog' -%}
{%- assign pageDescription = post.description | markdown | strip_html -%}
{%- elsif artist.description -%}
{%- assign pageDescription = artist.description | markdown | strip_html | truncatewords: 50 -%}
{%- assign pageDescription = artist.description | markdown | strip_html | htmlTruncate -%}
{%- elsif book.description -%}
{%- assign pageDescription = book.review | markdown | strip_html | default: book.description | truncatewords: 50 -%}
{%- assign pageDescription = book.review | markdown | strip_html | default: book.description | htmlTruncate -%}
{%- elsif movie.description -%}
{%- assign pageDescription = movie.review | markdown | strip_html | default: movie.description | truncatewords: 50 -%}
{%- assign pageDescription = movie.review | markdown | strip_html | default: movie.description | htmlTruncate -%}
{%- elsif show.description -%}
{%- assign pageDescription = show.review | markdown | strip_html | default: show.description | truncatewords: 50 -%}
{%- assign pageDescription = show.review | markdown | strip_html | default: show.description | htmlTruncate -%}
{%- elsif genre.description -%}
{%- assign pageDescription = genre.description | markdown | strip_html | truncatewords: 50 -%}
{%- assign pageDescription = genre.description | markdown | strip_html | htmlTruncate -%}
{%- elsif page.description -%}
{%- assign pageDescription = page.description -%}
{%- elsif description -%}

View file

@ -17,7 +17,7 @@
"id": "{{ entry.feed.url | encodeAmp }}",
"url": "{{ entry.feed.url | encodeAmp }}",
"title": "{{ entry.feed.title | escape }}",
"content_text": "{{ entry.feed.description | markdown | strip_html | escape| normalize_whitespace | rstrip | truncatewords: 50, '...' }}",
"content_text": "{{ entry.feed.description | markdown | strip_html | escape| normalize_whitespace | rstrip | htmlTruncate }}",
"date_published": "{{ entry.feed.date | stringToRFC3339 }}"
}{%- if forloop.last == false -%},{%- endif -%}
{%- endfor -%}

View file

@ -13,7 +13,7 @@
<h3>
<a href="{{ post.url }}">{{ post.title }}</a>
</h3>
{{ post.description | normalize_whitespace | markdown | truncatewords: 50 }}
{{ post.description | normalize_whitespace | markdown | htmlTruncate }}
</article>
{%- endfor -%}
<a class="icon-link" href="/posts">View all posts {% tablericon "arrow-right" %}</a>