如何修复博客页面中自定义摘录的空输出?
How to fix empty ouput of custom excerpt in Blog page?
我在我的博客中使用自定义摘录 post,但如果摘录的长度太长,我得到一个空输出。
如果我在摘录中减少一些单词,那么它就起作用了。
您有任何解决方法吗?
谢谢
我的post配置:
---
title: Test a Perceptual Phenomenon
layout: notebook
excerpt: In a Stroop task, participants are presented with a list of words, with each word displayed in a color of ink. The participant’s task is to say out loud the color of the ink in which the word is printed.
---
我的博客页面:
---
layout: default
title: Blog
---
<h1>Latest Posts</h1>
<ul>
{% for post in site.posts %}
<li>
<h2><a href="{{ post.url }}">{{ post.title }}</a></h2>
<p>{{ post.excerpt }}</p>
<p>{{ post.post_description }}</p>
</li>
{% endfor %}
</ul>
好的。我设法使用 this file 重现了您的问题。
这是因为你的前言中使用了冒号 post_description
。
例如:post_description: In a Stroop task, ... The task has two conditions: a congruent ...
要解决此问题,您可以使用引号或双引号。
post_description: 'Your text with escaped \'quotes\' and "double quotes" : success'
post_description: "Your text with 'quotes' and \"escaped double quotes\" : success'
或者你可以使用多行字符串
post_description : >
A long text with special characters : success !
Another line.
我在我的博客中使用自定义摘录 post,但如果摘录的长度太长,我得到一个空输出。
如果我在摘录中减少一些单词,那么它就起作用了。 您有任何解决方法吗?
谢谢
我的post配置:
---
title: Test a Perceptual Phenomenon
layout: notebook
excerpt: In a Stroop task, participants are presented with a list of words, with each word displayed in a color of ink. The participant’s task is to say out loud the color of the ink in which the word is printed.
---
我的博客页面:
---
layout: default
title: Blog
---
<h1>Latest Posts</h1>
<ul>
{% for post in site.posts %}
<li>
<h2><a href="{{ post.url }}">{{ post.title }}</a></h2>
<p>{{ post.excerpt }}</p>
<p>{{ post.post_description }}</p>
</li>
{% endfor %}
</ul>
好的。我设法使用 this file 重现了您的问题。
这是因为你的前言中使用了冒号 post_description
。
例如:post_description: In a Stroop task, ... The task has two conditions: a congruent ...
要解决此问题,您可以使用引号或双引号。
post_description: 'Your text with escaped \'quotes\' and "double quotes" : success'
post_description: "Your text with 'quotes' and \"escaped double quotes\" : success'
或者你可以使用多行字符串
post_description : >
A long text with special characters : success !
Another line.