Skip to content

Commit

Permalink
Docs: update bilibili shortcode documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Lruihao committed Nov 6, 2023
1 parent 2f0c65c commit 0f108cd
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ categories:
hiddenFromHomePage: true
---

{{< version 0.2.0 changed >}}

The `bilibili` shortcode embeds a responsive video player for bilibili videos.

<!--more-->

## Usages

When the video only has one part, only the BV `id` of the video is required, e.g.:

```code
Expand Down Expand Up @@ -61,3 +61,35 @@ Or
The rendered output looks like this:

{{< bilibili id=BV1TJ411C7An p=3 >}}

## Options

The `bilibili` shortcode has the following named parameters:

- **id** _[required]_ (**first** positional parameter)

The BV `id` of the video.

- **p** _[optional]_ (**second** positional parameter)

Number of episodes of multi-P videos. Counting starts from `1`, default value is `1`.

- **autoplay** _[optional]_ {{< version 0.2.18-lts.4 >}}

Whether to autoplay, default value is `false`.

- **poster** _[optional]_ {{< version 0.2.18-lts.4 >}}

Whether to show the poster, default value is `true`.

- **muted** _[optional]_ {{< version 0.2.18-lts.4 >}}

Whether to mute, default value is `true`.

- **danmaku** _[optional]_ {{< version 0.2.18-lts.4 >}}

Whether to enable danmaku, default value is `true`.

- **t** _[optional]_ {{< version 0.2.18-lts.4 >}}

Jump to the initial time point of the media, default value is `0`, unit: second.
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ categories:
hiddenFromHomePage: true
---

{{< version 0.2.0 changed >}}

`bilibili` shortcode 提供了一个内嵌的用来播放 bilibili 视频的响应式播放器。

<!--more-->

## 快速使用

如果视频只有一个部分,则仅需要视频的 BV `id`, 例如:

```code
Expand Down Expand Up @@ -60,3 +60,35 @@ https://www.bilibili.com/video/BV1TJ411C7An?p=3
呈现的输出效果如下:

{{< bilibili id=BV1TJ411C7An p=3 >}}

## 详细参数

`bilibili` shortcode 有以下命名参数:

- **id** _[必需]_**第一个**位置参数)

视频的 BV `id`

- **p** _[可选]_**第二个**位置参数)

多 P 视频的集数。从 `1` 开始计数,默认值为 `1`

- **autoplay** _[可选]_ {{< version 0.2.18-lts.4 >}}

是否自动播放,默认值为 `false`

- **poster** _[可选]_ {{< version 0.2.18-lts.4 >}}

是否展示封面,默认值为 `true`

- **muted** _[可选]_ {{< version 0.2.18-lts.4 >}}

是否静音,默认值为 `true`

- **danmaku** _[可选]_ {{< version 0.2.18-lts.4 >}}

是否开启弹幕,默认值为 `true`

- **t** _[可选]_ {{< version 0.2.18-lts.4 >}}

跳转到媒体的初始时间点,默认值为 `0`,单位:秒。

0 comments on commit 0f108cd

Please sign in to comment.