Skip to content

Commit

Permalink
feat: add bilibili embed video support (#1406)
Browse files Browse the repository at this point in the history
---------
Co-authored-by: Cotes Chung <11371340+cotes2020@users.noreply.github.com>
mill413 authored Dec 9, 2023
1 parent 2a4fbf6 commit 4a2b89d
Showing 3 changed files with 17 additions and 7 deletions.
10 changes: 10 additions & 0 deletions _includes/embed/bilibili.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<iframe
class="embed-video bilibili"
loading="lazy"
src="https://player.bilibili.com/player.html?bvid={{ include.id }}"
scrolling="no"
border="0"
frameborder="no"
framespacing="0"
allowfullscreen="true"
></iframe>
11 changes: 5 additions & 6 deletions _posts/2019-08-08-write-a-new-post.md
Original file line number Diff line number Diff line change
@@ -424,12 +424,11 @@ Where `Platform` is the lowercase of the platform name, and `ID` is the video ID

The following table shows how to get the two parameters we need in a given video URL, and you can also know the currently supported video platforms.

| Video URL | Platform | ID |
|----------------------------------------------------------------------------------------------------|-----------|:--------------|
| [https://www.**youtube**.com/watch?v=**H-B46URT4mg**](https://www.youtube.com/watch?v=H-B46URT4mg) | `youtube` | `H-B46URT4mg` |
| [https://www.**twitch**.tv/videos/**1634779211**](https://www.twitch.tv/videos/1634779211) | `twitch` | `1634779211` |


| Video URL | Platform | ID |
| -------------------------------------------------------------------------------------------------- | ---------- | :------------- |
| [https://www.**youtube**.com/watch?v=**H-B46URT4mg**](https://www.youtube.com/watch?v=H-B46URT4mg) | `youtube` | `H-B46URT4mg` |
| [https://www.**twitch**.tv/videos/**1634779211**](https://www.twitch.tv/videos/1634779211) | `twitch` | `1634779211` |
| [https://www.**bilibili**.com/video/**BV1Q44y1B7Wf**](https://www.bilibili.com/video/BV1Q44y1B7Wf) | `bilibili` | `BV1Q44y1B7Wf` |

## Learn More

3 changes: 2 additions & 1 deletion _sass/addon/commons.scss
Original file line number Diff line number Diff line change
@@ -551,7 +551,8 @@ main {

@extend %rounded;

&.youtube {
&.youtube,
&.bilibili {
aspect-ratio: 16 / 9;
}

0 comments on commit 4a2b89d

Please sign in to comment.