{%- comment -%}
  Get post description or generate it from the post content.
{%- endcomment -%}

{%- assign max_length = include.max_length | default: 200 -%}

{%- capture description -%}
{%- if post.description -%}
  {{- post.description -}}
{%- else -%}
  {%- include no-linenos.html content=post.content -%}
  {{- content | markdownify | strip_html -}}
{%- endif -%}
{%- endcapture -%}

{{- description | strip | truncate: max_length | escape -}}
