2022 主题bug修复

This commit is contained in:
Vaica committed 2026-06-24 20:22:40 +08:00
1 parent a6b1098d60
commit 56ea059fc0
16 files changed
+1357 -334

No files matched your search

+14 -4
View File
@@ -43,9 +43,19 @@
{{ $muted := .Get "muted" | default "false" }}
{{ $isGifMode := or (eq $loop "true") (eq $muted "true") }}
{{ $videoSrc := $src }}
{{ if not (hasPrefix $src "http") }}
{{ $videoSrc = printf "/%s/%s" .Page.Slug $src }}
{{ end }}
{{ $posterSrc := $poster }}
{{- if and $src (not (findRE "^(https?://|/)" $src)) -}}
{{- with .Page.Resources.GetMatch $src -}}
{{- $videoSrc = .RelPermalink -}}
{{- end -}}
{{- end -}}
{{- if and $poster (not (findRE "^(https?://|/)" $poster)) -}}
{{- with .Page.Resources.GetMatch $poster -}}
{{- $posterSrc = .RelPermalink -}}
{{- end -}}
{{- end -}}
{{ if $isGifMode }}
{{/* GIF 模式:图片标签显示,自动循环 */}}
@@ -59,7 +69,7 @@
{{/* 视频模式:自定义播放器 */}}
<div class="video-wrap">
<figure class="video-player" onclick="toggleVideo(this)">
<video preload="metadata" playsinline webkit-playsinline {{ with $poster }}poster="{{ . }}"{{ end }}>
<video preload="metadata" playsinline webkit-playsinline {{ with $posterSrc }}poster="{{ . }}"{{ end }}>
<source src="{{ $videoSrc }}">
</video>
<div class="video-play-icon">