Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/vickylaixy/hugo-theme-introduction.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'layouts/partials/home/projects.html')
-rw-r--r--layouts/partials/home/projects.html19
1 files changed, 16 insertions, 3 deletions
diff --git a/layouts/partials/home/projects.html b/layouts/partials/home/projects.html
index 2c51a8b..f0e5a6c 100644
--- a/layouts/partials/home/projects.html
+++ b/layouts/partials/home/projects.html
@@ -58,9 +58,22 @@
{{ end }}
{{ with .Resources.ByType "image" }}
- {{ range first 1 (sort . "Params.weight") }}
- {{ $image := .Resize "640x" }}
- <img src="{{ $image.Permalink }}" alt ="{{ $image.Name }}">
+ {{ $moreThenOneImage := gt (len .) 1 }}
+ {{ if $moreThenOneImage }}
+ <div class="owl-carousel owl-theme">
+ {{ end }}
+ {{ range sort . "Params.weight" }}
+ {{ $image := .Resize "640x" }}
+ {{ if $moreThenOneImage }}
+ <div class="item owl-height">
+ {{ end }}
+ <img src="{{ $image.RelPermalink }}" class="img-responsive" alt="{{ $image.Name }}">
+ {{ if $moreThenOneImage }}
+ </div>
+ {{ end }}
+ {{ end }}
+ {{ if $moreThenOneImage }}
+ </div>
{{ end }}
{{ end }}