diff --git a/example/content/markdown-format.md b/example/content/markdown-format.md index 4c05133..567b137 100644 --- a/example/content/markdown-format.md +++ b/example/content/markdown-format.md @@ -2,6 +2,7 @@ date: 2024-10-17 12:00:01 slug: markdown-format title: Markdown Formatting Options +description: The content here accepts any valid CommonMark or Github Flavoured markdown and some GFM extensions. tags: docs, markdown, Common Mark, GFM extra: math: true diff --git a/example/templates/list.html b/example/templates/list.html index 6ae4f1e..78af6d2 100644 --- a/example/templates/list.html +++ b/example/templates/list.html @@ -16,7 +16,13 @@ {%- for content in content_list %}

{{ content.title | capitalize }}

-

{{ content.html | striptags | trim_start_matches(pat=content.title) | truncate(length=100, end="...") }}

+

+ {% if content.description %} + {{ content.description | replace(from='"', to="") | truncate(length=100, end="...") }} + {% else %} + {{ content.html | striptags | trim_start_matches(pat=content.title) | truncate(length=100, end="...") }} + {%- endif %} +

{% if content.date -%}