add fancy-box

This commit is contained in:
FarseaSH 2021-08-30 18:38:17 +08:00
parent f8803b75b9
commit d3b9e6880f
4 changed files with 10 additions and 4 deletions

View file

@ -10,3 +10,6 @@
}
});
</script>
<!-- fancybox -->
<script src="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox.umd.js"></script>

View file

@ -31,5 +31,8 @@
<!-- the Moments style css file -->
<link rel="stylesheet" type="text/css" href="{{.Site.BaseURL}}/css/style.css">
<!-- 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"/>
<!-- website title -->
<title>{{ .Site.Params.title }}</title>

View file

@ -13,11 +13,11 @@
{{range $num,$a := .pic_set}}
{{if eq $num 0 }}
<div class="carousel-item active">
<img src="{{$a}}" class="d-block w-100 pic-in-set" alt="{{add $num 1}}">
<img src="{{$a}}" class="d-block w-100 pic-in-set" alt="{{add $num 1}}" data-fancybox="gallery">
</div>
{{else}}
<div class="carousel-item">
<img src="{{$a}}" class="d-block w-100 pic-in-set" alt="{{add $num 1}}">
<img src="{{$a}}" class="d-block w-100 pic-in-set" alt="{{add $num 1}}" data-fancybox="gallery">
</div>
{{end}}
{{end}}

View file

@ -53,7 +53,7 @@
<!-- 图片 -->
{{ with .Params.pic }}
<img src="{{ . }}" class="img-fluid pic1" alt="Responsive image"></img>
<img src="{{ . }}" class="img-fluid pic1" alt="Responsive image" data-fancybox="gallery"></img>
{{ end }}
<!-- 图片集 -->