Browse Source

feat: support .webm videos in Video Shortcode

Close #1226
George Cushen 6 năm trước cách đây
mục cha
commit
e24de2a2ca
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      layouts/shortcodes/video.html

+ 1 - 1
layouts/shortcodes/video.html

@@ -7,7 +7,7 @@
 {{ end }}
 
 {{ $video := printf "%s%s" $path (.Get "src") }}
-{{ $video_type := substr (.Get "src") -1 3 }}
+{{ $video_type := strings.TrimPrefix "." (path.Ext (.Get "src")) }}
 {{ if .Get "library" }}
   {{ $video = $video | relURL }}
 {{ end }}