enten / hyde-y

Enhanced port of the Jekyll "Hyde" theme to Hugo
MIT License
88 stars 62 forks source link

Use Pygments/Chroma instead of highlight.js #40

Open dusty-phillips opened 6 years ago

dusty-phillips commented 6 years ago

It seems like highlight.js is no longer maintained, and I'm finding it is not highlighting my styles effectively. I also can't figure out how to get line numbers and highlighting in place, though that may be on me. ;-)

Is there a way to disable highlight.js and revert to normal hugo/pygments for syntax highlighting?

dusty-phillips commented 6 years ago

Actually I see the project is receiving commits, but hasn't made a release. Either way, I'd still like to revert hyde-y to chroma, as I've been struggling with my source code highlighting all day. Any tips?

enten commented 6 years ago

Is there a way to disable highlight.js and revert to normal hugo/pygments for syntax highlighting?

The highlight.js import is in layouts/partials/base/imports.html only if site param highlight is defined.

The value defined in site param highlight is used in layouts/partials/base/imports.html to import the right css stylesheet.

We should update these lines to remove highlight.js.

Actually I see the project is receiving commits, but hasn't made a release.

I'm open to pull request to make a huge update.

Either way, I'd still like to revert hyde-y to chroma

Sorry, I don't understand. Can you explain what's chroma means?

dusty-phillips commented 6 years ago

Oh, sorry, I meant that highlight.js was receiving commits but hadn't made a release. I run off of hyde-y master, so I don't need a release to the theme. :-)

Chroma is the default syntax highlighter provided by hugo (https://gohugo.io/content-management/syntax-highlighting/).

I found the highlight.js import in layouts/partials/base/scripts.html. I added the {{ if isset .Site.Params "highlight" }} around the with and it seems to be working. I'll test some more and put up a pull request if it continues to work.

dusty-phillips commented 6 years ago

It's working a little. I am getting issues with line numbers and fenced codeblocks aren't working. I suspect the latter is a mistake in my config. The line numbers issue could be a problem with the theme or with hugo itself, I'm not sure.

Thanks for the tip about what to disable!