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 a Copy-to-Clipboard button and support bilibili video #2508

Closed
sunete opened this issue Apr 28, 2020 · 6 comments
Closed

Add a Copy-to-Clipboard button and support bilibili video #2508

sunete opened this issue Apr 28, 2020 · 6 comments

Comments

@sunete
Copy link
Contributor

sunete commented Apr 28, 2020

Summary

  1. add a Copy-to-Clipboard button to the code block.

  2. Make the theme support to instert bilibili video.

Motivation

add button

I think Copy-to-Clipboard button is necessary for this theme. A lot of posts contain code blocks. Now, this theme doesn't have a clip-to-clipboard button. When someone needs to copy the code, they need to select all the code and ctrl+C to copy to clipboard. It is a waste of time and inconvenience. Besides, some characters will be left. But if you add a button to the code block, it will be convenient.

I have searched for some articles to add a button by myself. I haven't learned programming before, so I can't finish it.

support post bilibili video

Can you make this theme supports insert bilibili video which is a very popular video website in China? When I instert a bilibili video in the post, it couldn't adapt to the width. This problem may not be what most people need. So I tried to solve this problem by myself. Finally I made it.
This is the code in _includes/video

<div class="responsive-video-container">
  <iframe src="//player.bilibili.com/player.html?bvid={{ video_id }}&page=1&as_wide=1&high_quality=1&danmaku=0" scrolling="no" border="0" frameborder="no" framespacing="0" allowfullscreen="true"> </iframe>
</div>
@iBug
Copy link
Collaborator

iBug commented Apr 30, 2020

Hi, thanks for the suggestion. It seems like you've already figured out about the Bilibili video suggestion, so it'd be great if you could wrap it up and submit a pull request. We'd love to see your contribution! You can check out the documentation on contributing if you're looking for a how-to.

@sunete
Copy link
Contributor Author

sunete commented Apr 30, 2020

OK,I will creat a pull request later. How about the copy-to-clipboard button? Is it possible to add the button in the next version?

@mmistakes
Copy link
Owner

Depends on the solution for doing a copy and paste button for code blocks. The ones I've seen are clunky and don't let you use standard Markdown (```) fenced code blocks, which is a deal breaker for me. Also not exactly sold on adding extra JavaScript to the theme for this.

@iBug
Copy link
Collaborator

iBug commented Apr 30, 2020

@mmistakes No worries. I'm 100% sure this could be done in JS-only, i.e. use JS to add buttons to every code block after page load (like it's already done for the heading anchor).

@mmistakes
Copy link
Owner

Added bilibili support in #2512

@dieghernan
Copy link

See #2795

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

No branches or pull requests

4 participants