From 4e29d5e5ca55dc509d10320b893be62beaf7cd7c Mon Sep 17 00:00:00 2001 From: Cell <1024@lruihao.cn> Date: Mon, 6 Nov 2023 17:56:44 +0800 Subject: [PATCH] :sparkles: Feat: add more options support for bilibili shortcode, e.g. `autoplay`, `muted` etc. (resolve #375) --- docs | 2 +- layouts/shortcodes/bilibili.html | 15 ++++++++++----- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/docs b/docs index 2f0c65c6..0f108cd0 160000 --- a/docs +++ b/docs @@ -1 +1 @@ -Subproject commit 2f0c65c6b52376dd377fd456b0c276ce7a63132c +Subproject commit 0f108cd09033d780606ffe0d1e901aa8fcba9f5e diff --git a/layouts/shortcodes/bilibili.html b/layouts/shortcodes/bilibili.html index a0aae333..b0e50b65 100644 --- a/layouts/shortcodes/bilibili.html +++ b/layouts/shortcodes/bilibili.html @@ -1,8 +1,13 @@ +{{- /* reference https://player.bilibili.com/ */ -}} +{{- $bvid := cond .IsNamedParams (.Get "id") (.Get 0) -}} +{{- $p := cond .IsNamedParams (.Get "p") (.Get 1) | default 1 -}} +{{- $autoplay := .Get "autoplay" | default false -}} +{{- $poster := .Get "poster" | default true -}} +{{- $muted := .Get "muted" | default true -}} +{{- $danmaku := .Get "danmaku" | default true -}} +{{- $t := .Get "t" | default 0 -}} +
- {{- if .IsNamedParams -}} - - {{- else -}} - - {{- end -}} +
{{- /* EOF */ -}}