Merge pull request #10 from atompi/dev

feat: add local video support
This commit is contained in:
FarseaSH 2023-04-04 16:37:13 +08:00 committed by GitHub
commit d64d41e7e6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 4 deletions

View file

@ -14,6 +14,9 @@
<!-- fancybox --> <!-- fancybox -->
<script src="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox.umd.js"></script> <script src="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox.umd.js"></script>
<!-- videojs -->
<script src="https://vjs.zencdn.net/8.0.4/video.min.js"></script>
{{/* a pangu support */}} {{/* a pangu support */}}
{{ if .Site.Params.features.pangu }} {{ if .Site.Params.features.pangu }}
<!-- pangu.js --> <!-- pangu.js -->

View file

@ -39,6 +39,9 @@
<!-- fancybox css (js in the end before the body closing tag) --> <!-- fancybox css (js in the end before the body closing tag) -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox.css"/> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox.css"/>
<!-- videojs -->
<link href="https://vjs.zencdn.net/8.0.4/video-js.min.css" rel="stylesheet" />
<!-- pure.css --> <!-- pure.css -->
<link rel="stylesheet" href="https://unpkg.com/purecss@2.0.6/build/base-min.css"> <link rel="stylesheet" href="https://unpkg.com/purecss@2.0.6/build/base-min.css">
<link rel="stylesheet" href="https://unpkg.com/purecss@2.0.6/build/grids-min.css"> <link rel="stylesheet" href="https://unpkg.com/purecss@2.0.6/build/grids-min.css">
@ -64,4 +67,3 @@
<!-- website title --> <!-- website title -->
<title>{{ .Site.Params.title }}</title> <title>{{ .Site.Params.title }}</title>

View file

@ -71,6 +71,13 @@
{{ end }} {{ end }}
{{ end }} {{ end }}
{{ $video_caption := .Plain}}
{{ with .Params.video }}
<a data-src="{{ . }}" data-fancybox="video-gallery" data-caption={{ $video_caption }}>
<video class="video-js" src="{{ . }}"></video>
</a>
{{ end }}
{{ if (eq (len $pictures_set) 1) }} {{ if (eq (len $pictures_set) 1) }}
{{ range $pictures_set }} {{ range $pictures_set }}
<img src="{{ . }}" class="single-pic" alt="Responsive image" data-fancybox="gallery" data-caption={{ $picture_caption }}></img> <img src="{{ . }}" class="single-pic" alt="Responsive image" data-fancybox="gallery" data-caption={{ $picture_caption }}></img>