Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

syntax coloring for code doesn't work #315

Open
arnaud-carre opened this issue Dec 28, 2022 · 2 comments
Open

syntax coloring for code doesn't work #315

arnaud-carre opened this issue Dec 28, 2022 · 2 comments

Comments

@arnaud-carre
Copy link

arnaud-carre commented Dec 28, 2022

Hi!
I forked your repo to create a blog about code. I modifyed the config file , adding

markdown: kramdown
highlighter: rouge
kramdown:
input: GFM

In a .md new post file, I use the syntax with three ` producing:

some code...

when looking at github "md" preview page, the code snippet has some colors. But when looking to the deployed github pages, the code is using "fixed size font" (as expected for a code block) but doesn't have any color.

Any hint to fix that?

@hojongs
Copy link

hojongs commented Jan 19, 2023

Same problem here.

@HEMAndonov98
Copy link

Hi there,

I was able to get syntax highlighting working in my project by using Rougify. Here's the configuration I used:

markdown: kramdown
kramdown:
    input: GFM
    syntax_highlighter: rouge

I then used

 rougify style gruvbox > css/gruvbox.css

to generate the CSS file and included it in _includes/head.html:

It's important to note that this approach assumes the theme doesn't have built-in syntax highlighting. If it does, there might be other configuration options within the theme itself.

You could consider exploring integration of a syntax highlighter like Rougify (or alternatively Prism.js or highlight.js) to provide this functionality within the theme.

Let me know if you have any questions!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants