Enhance Bilibili video support (redo of #2522) (#2599)

* Enhance support for bilibili videos in responsive video helper, and add corresponding doc

* Apply @iBug's review in mmistakes/minimal-mistakes#2522

* Fix danmaku in page hero video

* Update video to use case..when for iframe src

* Update CHANGELOG and history

Co-authored-by: Anran <51769728+ALeafWolf@users.noreply.github.com>
Co-authored-by: Michael Rose <mmistakes@users.noreply.github.com>
This commit is contained in:
iBug ♦
2020-07-23 03:42:46 +08:00
committed by GitHub
parent 8711be97c6
commit 42c4df6244
5 changed files with 50 additions and 16 deletions

View File

@@ -179,6 +179,7 @@ Embed a video from YouTube, Vimeo, Google Drive, or bilibili that responsively s
| ---------- | ------------ | ---------------------------------------------------------- |
| `id` | **Required** | ID of the video |
| `provider` | **Required** | Hosting provider of the video: `youtube`, `vimeo`, `google-drive`, or `bilibili` |
| `danmaku` | Optional | Bilibili only, [details below](#Bilibili) |
### YouTube
@@ -240,6 +241,30 @@ header:
provider: google-drive
```
### Bilibili
To embed the following Bilibili video at url `https://www.bilibili.com/video/BV1E7411e7hC` into a post or page's main content you'd use:
```liquid
{% raw %}{% include video id="BV1E7411e7hC" provider="bilibili" %}{% endraw %}
```
If you want to enable danmaku (弹幕) for the embeded video, which is disabled by default, you can supply an additional parameter `danmaku="1"` as shown below:
```liquid
{% raw %}{% include video id="BV1E7411e7hC" provider="bilibili" danmaku="1" %}{% endraw %}
```
To embed it as a video header you'd use the following YAML Front Matter:
```yaml
header:
video:
id: BV1E7411e7hC
provider: bilibili
danmaku: 1
```
## Table of contents
Auto-generated table of contents list for your posts and pages can be enabled using two methods.