用Jekyll / Liquid和pygments突出显示html问题 [英] Highlight in html issue with Jekyll/Liquid and pygments

查看:141
本文介绍了用Jekyll / Liquid和pygments突出显示html问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在.html文章中使用Jekyll与pygments并且存在使用 {%highlight%} 的问题。正如您可以看到 此处 ,它只是在我的主页上打印出{%highlight%}语法突出显示效果请参见此处: iwasasuperhero。



此处是该索引的代码,以及该帖子的代码:这里

我不确定这个问题或为什么它在索引上工作,但而不是帖子页面。任何想法?

解决方案

似乎我已经找到了我的问题。我在我的post.html中使用了 {{page.content}} ,而不是 {{content}}

I'm using Jekyll with pygments and having an issue using {% highlight %} in .html posts. As you can see here, it is just printing out {% highlight %} yet on my homepage the syntax highlighting works See here: iwasasuperhero.

Here is the code for the index, and the code for the post: Here

I'm not really sure the issue or why it is working on the index but not the post page. Any ideas?

解决方案

It seems I have figured out my problem. I was using {{ page.content }} in my post.html instead of just {{ content }}.

这篇关于用Jekyll / Liquid和pygments突出显示html问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆