pages-themes / hacker

Hacker is a Jekyll theme for GitHub Pages

Home Page:https://pages-themes.github.io/hacker/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

for the life of me can't figure out syntax highlighting

erikyuzwa opened this issue · comments

I'm a new user to Github Pages, but a long-time Jekyll user.

I've got a code snippet that I'm trying to put in a blog post:

<link rel="alternate" type="application/atom+xml" title="{{ site.title }}" href="{{ '/feed.xml' |  prepend: site.url }}">

But on my Github pages site, the liquid syntax is being converted within those 3 ticks:

<link rel="alternate" type="application/atom+xml" title="Erik Yuzwa" href="https://erikyuzwa.github.io/feed.xml">

I've tried:

  • using {% highlight %} and {% endhighlight %}
  • looking at posts mentioning any configuration needed of Kramdown for Github Pages specifically
  • looking at Github Pages syntax documentation

Everything I can find implies that the code snippet I've posted in this issue should work no problem in a post in my Jekyll blog, yet it can't.

I have been able to do this with the raw tag.

{% raw %}
<link rel="alternate" type="application/atom+xml" title="{{ site.title }}" href="{{ '/feed.xml' |  prepend: site.url }}">
{% endraw %}

I put the three ticks around the code and the tags render in the code snippet. I also add html after the first three ticks.

See example of one of my posts here. Look at line 133 for a simple example.

@jimhall you are a genius - this incantation worked like a charm for me! 🙇 ❤️