TruncateHtml不适用于github博客

时间:2014-08-16 03:42:08

标签: html markdown jekyll truncate github-pages

我正在.github.io上写博客

正如Github所建议的那样,我使用的是Jekyll结构。我希望以Markdown的形式发布我的博客,但我也希望我的索引显示帖子的截断原始文本,而不显示和辅助符号

我写了<div>{{ post.content |truncatehtml |truncatewords: 30 }}</div>。它适用于localhost,但在我的博客http://piscesdream.github.io/

上无效

我该如何解决?

1 个答案:

答案 0 :(得分:0)

看起来truncatehtml功能正在提供插件,使用GitHub页面时不支持插件,尝试使用<div>{{ post.content | strip_html | truncatewords:30 }}</div>之类的内容。