Skip to content

Commit

Permalink
docs: list code block copy button config (#412)
Browse files Browse the repository at this point in the history
* fix: list code block copy button config

* Mention copy button config in the guide
  • Loading branch information
yuri1969 authored Jul 7, 2024
1 parent 1313415 commit 56f6f19
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
11 changes: 9 additions & 2 deletions exampleSite/content/docs/guide/syntax-highlighting.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions exampleSite/hugo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,12 @@ params:
sortBy: date
sortOrder: desc # or "asc"

highlight:
copy:
enable: true
# hover | always
display: hover

comments:
enable: false
type: giscus
Expand Down

0 comments on commit 56f6f19

Please sign in to comment.