-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
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
Liquid code being displayed in related-posts.html #1596
Comments
Another, perhaps better solution, is to look for a 'description' field in the post Front Matter. If it does not exist, carry on as usual, if it does exist however, use it in the related-posts (Further Reading) sections, and also in the descriptive blurb in the home page. So the code might go from this: {% include no-linenos.html content=post.content %}
{{ content | markdownify | strip_html | truncate: 200 | escape }} to this: (% if post.description %}
{{ post.description | markdownify | strip_html | truncate: 200 | escape }}
{% else %}
{% include no-linenos.html content=post.content %}
{{ content | markdownify | strip_html | truncate: 200 | escape }}
{% endif %} |
I think it's a great feature to have a I would like to have this feature for my posts as well, to have control over the post description that appears in multiple places. I will work on it. P.S. The originally reported issue should be fixed separately and I see no proper way to handle it so far. |
Which version of Chirpy are you using? Please fill in the software environment, and an example of Liquid code that can reproduce the issue. Otherwise it will be considered as an invalid report, thanks. |
I'm able to reproduce the problem reported on latest ---
title: Writing a New Post
author: cotes
date: 2019-08-08 14:10:00 +0800
categories: [Blogging, Tutorial]
tags: [writing]
render_with_liquid: false
---
{% include embed/youtube.html id='Balreaj8Yqs' %} |
@kungfux Note the special variable for that post: ---
render_with_liquid: false
--- If you comment out this line, Jekyll will render the liquid code |
My bad. You're right. I made it in hurry cause I was pretty sure I reproduced it a few days back. Now I see why do you ask to provide necessary details 😅 Thanks @cotes2020. |
I updated my op with version details. |
Checklist
How did you create the site?
Generated from
chirpy-starter
Describe the bug
In my post markdown, if I have any liquid code immediately after the Front Matter, when this post is displayed in the "Further Reading" section (which I believe is defined by related-posts.html), then the liquid code is being displayed, instead of it being stripped out.
Steps To Reproduce
In related-posts.html the code to display a post is below, from line 85 or so. There doesn't look to be anything to strip out Liquid code.
Expected Behavior
I'm not a Jekyll expert by any means, but it looks like the code should be...
Environment
Anything else?
No response
The text was updated successfully, but these errors were encountered: