This question has been asked before, but none of the answers were helpful to my case. (Please see below)
I am running Jekyll 2.5.3, with the Ion Theme, and so far I was playing with it, successfully including LaTeX in posts. Now I was adding source code snippets, but the syntax highlighting isn't working.
I've tried all the things in the list below, and I was missing some CSS entries, but I don't know where or how I could include the styles. Note that classes are correctly added to the generated HTML, but I only get a monospaced font:
<div class="highlighter-rouge">
<pre class="highlight">
<code>
<span class="cp"><?php</span>
<span class="k">echo</span>
<span class="s1">'Hello world!'</span>
<span class="p">;</span>
<span class="cp">?></span>
</code>
</pre>
</div>
Manually I've modified the CSS file (css/style.css
) adding some styles from the default Jekyll theme:
/* SYNTAX HIGHLIGHT */
pre.highlight {
background: #fff;
}
.c { color: #998; font-style: italic } // Comment
.err { color: #a61717; background-color: #e3d2d2 } // Error
.k { color: #000; font-weight: bold } // Keyword
.o { font-weight: bold } // Operator
/* ... */
Note that the pre.highlight
style works, if I change the background (or anything else) it works. I also made this CSS to load last, just to be sure.
I've tried may combinations (span.c
, code span.c
, ...), but I have almost zero experience with CSS, the only thing I had successfully modified is the pre.highlight
, which originally was only .highlight
.
Can anyone help me with this "little" issue? It's been driving me mad for some days...
Thanks!