Skip to content

Configure Hugo to allow copying code blocks to clipboard #77

Closed

Description

@johnthagen
  • I have searched the issues of this repo and believe that this is not a duplicate.

Issue

Many static site generators support a copy-to-clipboard button for code blocks. For example, see a Material for Mkdocs example:

GitHub also supports this, for example hover over the code blocks here:

This is especially useful for new users who want to quickly copy out commands such as the installation command that doesn't all fit on the screen at once.

It doesn't seem like this is something that Hugo supports out of the box unfortunately, but there are several guides on it:

Activity

  1. abn commented on May 16, 2022

    @abn
    Member

    Happy to accept PRs for this.

    The website code is available at https://github.com/python-poetry/website

  2. Secrus commented on May 17, 2022

    @Secrus
    Member

    Moving python-poetry/poetry#4981 here, as its original issue, but this one provides more info on how to handle the task.

  3. self-assigned this
    on May 19, 2022
  4. neersighted commented on Aug 31, 2022

    @neersighted
    Member

    An attempt was made in #37 but was reverted due to unforeseen breakage in production -- PRs attempting again using that one as a base are welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

documentationImprovements or additions to documentationgood first issueGood for newcomers

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions