Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/72.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
TruncateHtml在github博客上不起作用_Html_Markdown_Jekyll_Truncate_Github Pages - Fatal编程技术网

TruncateHtml在github博客上不起作用

TruncateHtml在github博客上不起作用,html,markdown,jekyll,truncate,github-pages,Html,Markdown,Jekyll,Truncate,Github Pages,我正在.github.io上写博客 正如Github建议的那样,我使用Jekyll结构。我想以降价的形式发布我的博客,但我也希望我的索引能够显示文章中被截断的原始文本,而不需要渲染和辅助符号 我写了{post.content | truncatehtml | truncatewords:30}}。它在localhost上运行良好,但在我的博客上不起作用 如何修复它?看起来truncatehtml功能是由一个插件提供的,使用GitHub页面时不支持插件,请尝试类似{post.content | s

我正在.github.io上写博客

正如Github建议的那样,我使用Jekyll结构。我想以降价的形式发布我的博客,但我也希望我的索引能够显示文章中被截断的原始文本,而不需要渲染和辅助符号

我写了{post.content | truncatehtml | truncatewords:30}}。它在localhost上运行良好,但在我的博客上不起作用

如何修复它?

看起来truncatehtml功能是由一个插件提供的,使用GitHub页面时不支持插件,请尝试类似{post.content | strip|u html | truncatewords:30}的方法。

它可以工作,非常感谢。strip_html是Jekyll中的标准过滤器吗?很高兴它起作用了,strip_html是标准液体标记的一部分。这里是一个帮助我做自己的网站很多。