mirror of
https://github.com/dillonzq/LoveIt.git
synced 2024-11-14 02:46:16 +01:00
fix(shortcode): fix new BV id for bilibili shortcode (#232)
This commit is contained in:
parent
90184ca3e7
commit
c56f219b3e
4 changed files with 38 additions and 32 deletions
|
@ -1134,44 +1134,46 @@ The `music` shortcode has the following named parameters only applying to the ty
|
|||
|
||||
## `bilibili`
|
||||
|
||||
{{< version 0.2.0 changed >}}
|
||||
|
||||
The `bilibili` shortcode embeds a responsive video player for bilibili videos.
|
||||
|
||||
When the video only has one part, only the `av` ID of the video is required, e.g.:
|
||||
When the video only has one part, only the BV `id` of the video is required, e.g.:
|
||||
|
||||
```code
|
||||
https://www.bilibili.com/video/av47027633
|
||||
https://www.bilibili.com/video/BV1Sx411T7QQ
|
||||
```
|
||||
|
||||
Example `bilibili` input:
|
||||
|
||||
```markdown
|
||||
{{</* bilibili 47027633 */>}}
|
||||
{{</* bilibili BV1Sx411T7QQ */>}}
|
||||
Or
|
||||
{{</* bilibili av=47027633 */>}}
|
||||
{{</* bilibili id=BV1Sx411T7QQ */>}}
|
||||
```
|
||||
|
||||
The rendered output looks like this:
|
||||
|
||||
{{< bilibili av=47027633 >}}
|
||||
{{< bilibili id=BV1Sx411T7QQ >}}
|
||||
|
||||
When the video has multiple parts, in addition to the `av` ID of the video,
|
||||
When the video has multiple parts, in addition to the BV `id` of the video,
|
||||
`p` is also required, whose default value is `1`, e.g.:
|
||||
|
||||
```code
|
||||
https://www.bilibili.com/video/av36570401?p=3
|
||||
https://www.bilibili.com/video/BV1TJ411C7An?p=3
|
||||
```
|
||||
|
||||
Example `bilibili` input with `p`:
|
||||
|
||||
```markdown
|
||||
{{</* bilibili 36570401 3 */>}}
|
||||
{{</* bilibili BV1TJ411C7An 3 */>}}
|
||||
Or
|
||||
{{</* bilibili av=36570401 p=3 */>}}
|
||||
{{</* bilibili id=BV1TJ411C7An p=3 */>}}
|
||||
```
|
||||
|
||||
The rendered output looks like this:
|
||||
|
||||
{{< bilibili av=36570401 p=3 >}}
|
||||
{{< bilibili id=BV1TJ411C7An p=3 >}}
|
||||
|
||||
## `typeit`
|
||||
|
||||
|
|
|
@ -1139,44 +1139,46 @@ The `music` shortcode has the following named parameters only applying to the ty
|
|||
|
||||
## `bilibili`
|
||||
|
||||
{{< version 0.2.0 changed >}}
|
||||
|
||||
The `bilibili` shortcode embeds a responsive video player for bilibili videos.
|
||||
|
||||
When the video only has one part, only the `av` ID of the video is required, e.g.:
|
||||
When the video only has one part, only the BV `id` of the video is required, e.g.:
|
||||
|
||||
```code
|
||||
https://www.bilibili.com/video/av47027633
|
||||
https://www.bilibili.com/video/BV1Sx411T7QQ
|
||||
```
|
||||
|
||||
Example `bilibili` input:
|
||||
|
||||
```markdown
|
||||
{{</* bilibili 47027633 */>}}
|
||||
{{</* bilibili BV1Sx411T7QQ */>}}
|
||||
Or
|
||||
{{</* bilibili av=47027633 */>}}
|
||||
{{</* bilibili id=BV1Sx411T7QQ */>}}
|
||||
```
|
||||
|
||||
The rendered output looks like this:
|
||||
|
||||
{{< bilibili av=47027633 >}}
|
||||
{{< bilibili id=BV1Sx411T7QQ >}}
|
||||
|
||||
When the video has multiple parts, in addition to the `av` ID of the video,
|
||||
When the video has multiple parts, in addition to the BV `id` of the video,
|
||||
`p` is also required, whose default value is `1`, e.g.:
|
||||
|
||||
```code
|
||||
https://www.bilibili.com/video/av36570401?p=3
|
||||
https://www.bilibili.com/video/BV1TJ411C7An?p=3
|
||||
```
|
||||
|
||||
Example `bilibili` input with `p`:
|
||||
|
||||
```markdown
|
||||
{{</* bilibili 36570401 3 */>}}
|
||||
{{</* bilibili BV1TJ411C7An 3 */>}}
|
||||
Or
|
||||
{{</* bilibili av=36570401 p=3 */>}}
|
||||
{{</* bilibili id=BV1TJ411C7An p=3 */>}}
|
||||
```
|
||||
|
||||
The rendered output looks like this:
|
||||
|
||||
{{< bilibili av=36570401 p=3 >}}
|
||||
{{< bilibili id=BV1TJ411C7An p=3 >}}
|
||||
|
||||
## `typeit`
|
||||
|
||||
|
|
|
@ -1120,43 +1120,45 @@ data = [
|
|||
|
||||
## `bilibili`
|
||||
|
||||
{{< version 0.2.0 changed >}}
|
||||
|
||||
`bilibili` shortcode 提供了一个内嵌的用来播放 bilibili 视频的响应式播放器.
|
||||
|
||||
如果视频只有一个部分, 则仅需要视频的 `av` ID, 例如:
|
||||
如果视频只有一个部分, 则仅需要视频的 BV `id`, 例如:
|
||||
|
||||
```code
|
||||
https://www.bilibili.com/video/av47027633
|
||||
https://www.bilibili.com/video/BV1Sx411T7QQ
|
||||
```
|
||||
|
||||
一个 `bilibili` 示例:
|
||||
|
||||
```markdown
|
||||
{{</* bilibili 47027633 */>}}
|
||||
{{</* bilibili BV1Sx411T7QQ */>}}
|
||||
或者
|
||||
{{</* bilibili av=47027633 */>}}
|
||||
{{</* bilibili id=BV1Sx411T7QQ */>}}
|
||||
```
|
||||
|
||||
呈现的输出效果如下:
|
||||
|
||||
{{< bilibili av=47027633 >}}
|
||||
{{< bilibili id=BV1Sx411T7QQ >}}
|
||||
|
||||
如果视频包含多个部分, 则除了视频的 `av` ID之外, 还需要 `p`, 默认值为 `1`, 例如:
|
||||
如果视频包含多个部分, 则除了视频的 BV `id` 之外, 还需要 `p`, 默认值为 `1`, 例如:
|
||||
|
||||
```code
|
||||
https://www.bilibili.com/video/av36570401?p=3
|
||||
https://www.bilibili.com/video/BV1TJ411C7An?p=3
|
||||
```
|
||||
|
||||
一个带有 `p` 参数的 `bilibili` 示例:
|
||||
|
||||
```markdown
|
||||
{{</* bilibili 36570401 3 */>}}
|
||||
{{</* bilibili BV1TJ411C7An 3 */>}}
|
||||
或者
|
||||
{{</* bilibili av=36570401 p=3 */>}}
|
||||
{{</* bilibili id=BV1TJ411C7An p=3 */>}}
|
||||
```
|
||||
|
||||
呈现的输出效果如下:
|
||||
|
||||
{{< bilibili av=36570401 p=3 >}}
|
||||
{{< bilibili id=BV1TJ411C7An p=3 >}}
|
||||
|
||||
## `typeit`
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<div class="bilibili">
|
||||
{{- if .IsNamedParams -}}
|
||||
<iframe src="//player.bilibili.com/player.html?aid={{ .Get `av` }}&page={{ .Get `p` | default 1 }}" scrolling="no" border="0" frameborder="no" framespacing="0" allowfullscreen="true"></iframe>
|
||||
<iframe src="https://player.bilibili.com/player.html?bvid={{ .Get `id` }}&page={{ .Get `p` | default 1 }}" scrolling="no" border="0" frameborder="no" framespacing="0" allowfullscreen="true"></iframe>
|
||||
{{- else -}}
|
||||
<iframe src="//player.bilibili.com/player.html?aid={{ .Get 0 }}&page={{ .Get 1 | default 1 }}" scrolling="no" border="0" frameborder="no" framespacing="0" allowfullscreen="true"></iframe>
|
||||
<iframe src="https://player.bilibili.com/player.html?bvid={{ .Get 0 }}&page={{ .Get 1 | default 1 }}" scrolling="no" border="0" frameborder="no" framespacing="0" allowfullscreen="true"></iframe>
|
||||
{{- end -}}
|
||||
</div>
|
||||
|
|
Loading…
Reference in a new issue