-
-
Notifications
You must be signed in to change notification settings - Fork 5.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Would like the ability to have basic markdown formatting in the description; field of a post. #1764
Comments
Just delete {%- 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 -}}
+ {{- description | strip | truncate: max_length -}} The function of
In Jekyll blogs, the 'escape' filter is typically used to HTML-escape the output, ensuring that when rendered on a webpage, it won't be interpreted as HTML tags, thereby mitigating potential security risks such as XSS (Cross-Site Scripting) attacks. In the above code snippet in If you delete |
Thanks for the detailed explanation, much appreciated! I am a bit smarter now. would there be anything wrong with: {%- capture description -%}
{%- if post.description -%}
{{- post.description | strip | truncate: max_length | markdownify | escape -}}
{%- else -%} |
@steveng57 It doesn't work. |
Duplicate of #1739 |
Checklist
Is your feature request related to a problem? Please describe
The new description: field in the Front Matter YAML is awesome and works great. It would be even better if it could handle markdown used in the description, for bolding and italisizing etc.
For example:
description: This is a REALLY cool thing.
Would be rendered as:
This is a REALLY cool thing.
Describe the solution you'd like
The new description: field in the Front Matter YAML is awesome and works great. It would be even better if it could handle markdown used in the description, for bolding and italisizing etc.
Describe alternatives you've considered
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: