Skip to content

Commit 4a2b89d

Browse files
mill413cotes2020
andauthored
feat: add bilibili embed video support (#1406)
--------- Co-authored-by: Cotes Chung <11371340+cotes2020@users.noreply.github.com>
1 parent 2a4fbf6 commit 4a2b89d

File tree

3 files changed

+17
-7
lines changed

3 files changed

+17
-7
lines changed

_includes/embed/bilibili.html

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<iframe
2+
class="embed-video bilibili"
3+
loading="lazy"
4+
src="https://player.bilibili.com/player.html?bvid={{ include.id }}"
5+
scrolling="no"
6+
border="0"
7+
frameborder="no"
8+
framespacing="0"
9+
allowfullscreen="true"
10+
></iframe>

_posts/2019-08-08-write-a-new-post.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -424,12 +424,11 @@ Where `Platform` is the lowercase of the platform name, and `ID` is the video ID
424424

425425
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.
426426

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

434433
## Learn More
435434

_sass/addon/commons.scss

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -551,7 +551,8 @@ main {
551551

552552
@extend %rounded;
553553

554-
&.youtube {
554+
&.youtube,
555+
&.bilibili {
555556
aspect-ratio: 16 / 9;
556557
}
557558

0 commit comments

Comments
 (0)