From 56f6f19978aaa52fd04e76276f015f5ff9804035 Mon Sep 17 00:00:00 2001 From: yuri <1969yuri1969@gmail.com> Date: Sun, 7 Jul 2024 14:33:12 +0200 Subject: [PATCH] docs: list code block copy button config (#412) * fix: list code block copy button config * Mention copy button config in the guide --- exampleSite/content/docs/guide/syntax-highlighting.md | 11 +++++++++-- exampleSite/hugo.yaml | 6 ++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/exampleSite/content/docs/guide/syntax-highlighting.md b/exampleSite/content/docs/guide/syntax-highlighting.md index 799c5ecf..45cc50c5 100644 --- a/exampleSite/content/docs/guide/syntax-highlighting.md +++ b/exampleSite/content/docs/guide/syntax-highlighting.md @@ -78,11 +78,18 @@ def main(): say_hello() ``` - ### Copy Button -By default, copy button is enabled for code blocks. +By default, copy button is enabled for code blocks. Its behavior can changed by modifying the site configuration file: +```yaml {linenos=table,linenostart=42,filename="hugo.yaml"} +params: + highlight: + copy: + enable: true + # hover | always + display: hover +``` ## Supported Languages diff --git a/exampleSite/hugo.yaml b/exampleSite/hugo.yaml index 5b0776ac..d2c03d08 100644 --- a/exampleSite/hugo.yaml +++ b/exampleSite/hugo.yaml @@ -151,6 +151,12 @@ params: sortBy: date sortOrder: desc # or "asc" + highlight: + copy: + enable: true + # hover | always + display: hover + comments: enable: false type: giscus