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

add copy codeblock button #234

Merged
merged 3 commits into from
Apr 15, 2018
Merged

add copy codeblock button #234

merged 3 commits into from
Apr 15, 2018

Conversation

maple3142
Copy link
Contributor

PR Type

What kind of change does this PR introduce?

  • Bugfix.
  • Feature.
  • Code style update (formatting, local variables).
  • Refactoring (no functional changes, no api changes).
  • Build related changes.
  • CI related changes.
  • Documentation content changes.
  • Other... Please describe:

What is the current behavior?

No copy button in codeblock.

Issue Number(s): #67 #222

What is the new behavior?

A copy button on top-right of code block.

How to use?

In NexT _config.yml:

copycode: true

Does this PR introduce a breaking change?

  • Yes.
  • No.

@ivan-nginx
Copy link
Member

ivan-nginx commented Apr 15, 2018

I think need to move copycode option here:

hexo-theme-next/_config.yml

Lines 282 to 284 in 2cd0df2

codeblock:
border_radius:

codeblock: 
  border_radius: 
  copy_button: false

And language under post section here:

post:
  copy_button: Copy

@ivan-nginx ivan-nginx added this to the v6.2.0 milestone Apr 15, 2018
@ivan-nginx
Copy link
Member

Alright, just refactored as suggested in previous comment. Usage:

codeblock:
  copy_button: true

@maple3142 thank's! 👍

@ivan-nginx ivan-nginx merged commit a6f092a into theme-next:master Apr 15, 2018
tongluyang pushed a commit to tongluyang/hexo-theme-next that referenced this pull request Nov 19, 2019
* add copy codeblock button

* arrow function to normal function

* Refactored codeblock button.
stevenjoezhang referenced this pull request in next-theme/hexo-theme-next Aug 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants