Update video.html

This commit is contained in:
Vaica committed 2026-06-22 17:08:07 +08:00
1 parent fe8c99a53e
commit ad65bfbb4c
1 file changed
+6 -1
+6 -1
View File
@@ -43,6 +43,11 @@
{{ $src := .Get "src" }} {{ $src := .Get "src" }}
{{ $poster := .Get "poster" }} {{ $poster := .Get "poster" }}
{{ $caption := .Get "caption" }} {{ $caption := .Get "caption" }}
{{/* 自动补全 Page Bundle 路径 */}}
{{ $videoSrc := $src }}
{{ if not (hasPrefix $src "http") }}
{{ $videoSrc = printf "/%s/%s" .Page.Slug $src }}
{{ end }}
<figure class="post-video-wrapper"> <figure class="post-video-wrapper">
<div class="video-container"> <div class="video-container">
<video <video
@@ -52,7 +57,7 @@
playsinline playsinline
webkit-playsinline webkit-playsinline
> >
<source src="{{ $src }}"> <source src="{{ $videoSrc }}">
你的浏览器不支持视频播放。 你的浏览器不支持视频播放。
</video> </video>
</div> </div>