From 4fad5dce34c7b6a6ab2372a4982a9879b7655d14 Mon Sep 17 00:00:00 2001 From: Aditya Telange <21258296+adityatelange@users.noreply.github.com> Date: Fri, 22 Jan 2021 00:18:17 +0530 Subject: [PATCH] add FAQ for Using Hugo's Syntax highlighter "chroma" --- config.yml | 9 +++++ content/posts/papermod/papermod-faq.md | 37 +++++++++++++++++++ .../posts/papermod/papermod-installation.md | 9 +++++ 3 files changed, 55 insertions(+) diff --git a/config.yml b/config.yml index 9415451b..895fe902 100644 --- a/config.yml +++ b/config.yml @@ -173,6 +173,15 @@ taxonomies: tag: tags series: series +# markup: +# highlight: +# # anchorLineNos: true +# codeFences: true +# guessSyntax: true +# lineNos: true +# # noClasses: false +# style: monokai + privacy: vimeo: disabled: false diff --git a/content/posts/papermod/papermod-faq.md b/content/posts/papermod/papermod-faq.md index 9a0fae2c..16a4d24f 100644 --- a/content/posts/papermod/papermod-faq.md +++ b/content/posts/papermod/papermod-faq.md @@ -270,6 +270,43 @@ Add `#center` after image to center align an image --- +## Using Hugo's Syntax highlighter "chroma" + +1. Disable Highlight.js in site `config.yml` + +```yml +params: + assets: + disableHLJS: true +``` + +2. Set hugo's markdown styling in site `config.yml` + +```yml +markup: + highlight: + # anchorLineNos: true + codeFences: true + guessSyntax: true + lineNos: true + # noClasses: false + style: monokai +``` + +3. If you want `lineNos: true`, the background won't be proper. + +Add the following to `assets/css/extended/custom.css` + +```css +.chroma { + background-color: unset; +} +``` + +More Info : [Configure Markup - Highlight](https://gohugo.io/getting-started/configuration-markup#highlight) + +--- + ## References - [Override a Hugo theme](https://zwbetz.com/override-a-hugo-theme/) diff --git a/content/posts/papermod/papermod-installation.md b/content/posts/papermod/papermod-installation.md index 72dbcab3..49d611ff 100644 --- a/content/posts/papermod/papermod-installation.md +++ b/content/posts/papermod/papermod-installation.md @@ -196,6 +196,15 @@ menu: name: example.org url: https://example.org weight: 30 +# Read: https://github.com/adityatelange/hugo-PaperMod/wiki/FAQs#using-hugos-syntax-highlighter-chroma +# markup: +# highlight: +# # anchorLineNos: true +# codeFences: true +# guessSyntax: true +# lineNos: true +# # noClasses: false +# style: monokai ``` ---