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

Highlight.js -> Hugo's chromastyles #1364

Merged
merged 9 commits into from
Dec 31, 2023
Merged

Conversation

adityatelange
Copy link
Owner

@adityatelange adityatelange commented Dec 23, 2023

What does this PR change? What problem does it solve?

This PR adds hugo's built-in chromastyles replacing highlight.js as syntax highlighter.

  • Deprecates Params.assets.disableHLJS.
  • Uses catppuccin-macchiato as default theme. (https://xyproto.github.io/splash/docs/all.html)
  • Users can change syntax-highlight theme using:
    hugo gen chromastyles --style=stylename > assets/css/includes/chroma-styles.css
  • markup.highlight.noClasses should be set to false or pygmentsUseClasses should be set to true.

Was the change discussed in an issue or in the Discussions before?

#385

Tip

Feel free to test this code and review this PR and let me know if something feels broken.

PR Checklist

  • This change adds/updates translations and I have used the template present here.
  • I have enabled maintainer edits for this PR.
  • I have verified that the code works as described/as intended.
  • This change adds a Social Icon which has a permissive license to use it.
  • This change does not include any CDN resources/links.
  • This change does not include any unrelated scripts such as bash and python scripts.
  • This change updates the overridden internal templates from HUGO's repository.

@adityatelange adityatelange marked this pull request as ready for review December 23, 2023 16:03
@adityatelange
Copy link
Owner Author

image

@adityatelange adityatelange added the enhancement New feature or improvement label Dec 23, 2023
Copy link

sonarcloud bot commented Dec 24, 2023

Quality Gate Passed Quality Gate passed

The SonarCloud Quality Gate passed, but some issues were introduced.

11 New issues
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@adityatelange adityatelange merged commit 045c084 into master Dec 31, 2023
1 check passed
@adityatelange adityatelange deleted the feat/hljs-to-chromastyles branch December 31, 2023 05:08
@adityatelange adityatelange mentioned this pull request Dec 31, 2023
7 tasks
zer0ttl pushed a commit to zer0ttl/hugo-PaperMod that referenced this pull request Jan 24, 2024
* remove hljs

* rename var --hljs-bg to --code-block-bg

* bundle chroma-styles from css/includes/chroma-styles.css

* add compatibility fixes for papermod <-> chroma

* fix line-num and line padding and set width for line container to 100%

* After a lot of experimentation this compatiblity should work well

* fix inline line highlights not working

* Use catppuccin-macchiato as default theme with highlightStyle 'bg:#474733'

- hugo gen chromastyles --style catppuccin-macchiato --highlightStyle 'bg:#474733' > assets/css/includes/chroma-styles.css
ayedaemon pushed a commit to ayedaemon/hugo-PaperMod that referenced this pull request Mar 27, 2024
* remove hljs

* rename var --hljs-bg to --code-block-bg

* bundle chroma-styles from css/includes/chroma-styles.css

* add compatibility fixes for papermod <-> chroma

* fix line-num and line padding and set width for line container to 100%

* After a lot of experimentation this compatiblity should work well

* fix inline line highlights not working

* Use catppuccin-macchiato as default theme with highlightStyle 'bg:#474733'

- hugo gen chromastyles --style catppuccin-macchiato --highlightStyle 'bg:#474733' > assets/css/includes/chroma-styles.css
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant