first commit

This commit is contained in:
2025-07-10 15:45:00 +08:00
commit 3437c1a17f
2162 changed files with 623170 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
{{/* 获取图片的 URL 和 alt 文本 */}}
{{ $url := .Destination | safeURL }}
{{ $alt := .Text | safeHTML }}
{{/* 检查 URL 是否以 .mp3, .ogg, 或 .wav 结尾 */}}
{{ if or (strings.HasSuffix $url ".mp3") (strings.HasSuffix $url ".ogg") (strings.HasSuffix $url ".wav") }}
{{/* 如果是音频文件,就渲染成 <audio> 标签 */}}
<audio controls src="{{ $url }}">
你的浏览器不支持播放此音频。
</audio>
{{ else }}
{{/* 如果不是音频文件,就按正常方式渲染成 <img> 标签 */}}
<img src="{{ $url }}" alt="{{ $alt }}" {{ with .Title}} title="{{ . }}"{{ end }} />
{{ end }}