I used Github Pages to host my personal website and I am trying to create a post which contains code snippets with line numbers.
When I do a jekyll serve on my machine, locally I can see everything working as expected, viz.,
However, when I push it to my Github repo and try to view the site live, the line numbering breaks. I see the following
I am using code fences to specify the code, like so,
~```python"
import numpy as np
from scipy.integrate import odeint
import matplotlib.pyplot as plt
import seaborn as sns
sns
.set_style("darkgrid")
~```
I have also tried the liquid syntax {% highlight python linenos %} . . . {% endhighlight %}
but the problem persists.
My _config.yml
has the following settings
# Conversion
markdown: kramdown
highlighter: rouge
lsi: false
excerpt_separator: "\n\n"
incremental: false
# Markdown Processing
kramdown:
input: GFM
hard_wrap: false
auto_ids: true
footnote_nr: 1
entity_output: as_char
toc_levels: 1..6
smart_quotes: lsquo,rsquo,ldquo,rdquo
enable_coderay: false
syntax_highlighter_opts:
block:
line_numbers: true
# HTML Compression
# - http://jch.penibelst.de/
compress_html:
clippings: all
ignore:
envs: development
and the css/scss file can be found here.
I can't understand the reason behind this discrepancy and how can I solve it?
Edit: I tried commenting out the HTML compression portion in _config.yml
and I can then see the same error locally.