Skip to content

how to put a copy button in a post with code #78

Answered by Interstellar750
blusens asked this question in Q&A
Discussion options

You must be logged in to vote

Do you mean the "Copy Button" in the upper right corner of Fenced Code Blocks?

Of course, Urara does not include this button.

Among the sites built based on Urara that I know of, there are probably two implementation methods, they are:

kwchang0831's urara.kwchang0831.dev
Sevichecc's seviche.cc

You can take a look at their repositories, pick one you like, and add the required code to your repository.

But I don't know how kwchang0831 made this button, I can only tell you how to add it according to Sevichecc's method:

  1. Get the /src/lib/utils/copyCode.ts file of the Sevichecc/Urara-Blog repository, and put it into the same /src/lib/utils/ directory in your repository.
  2. Following the 7e7745e co…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by blusens
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants