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

github.com/2-REC/hugo-myportfolio-theme.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDerek Severin <severinderek@gmail.com>2019-03-18 10:03:32 +0300
committerDerek Severin <severinderek@gmail.com>2019-03-18 10:03:32 +0300
commitf6dbc30a2550a21909ec1e6ff1485fdf330f707a (patch)
tree26fc2a07ef5fc453d02037a7292c6624f470dcc7 /layouts/_default/limage.html
parent759b735270606b0390235a6d570dc91f41be1816 (diff)
Set number of columns for projects as configurable
Diffstat (limited to 'layouts/_default/limage.html')
-rw-r--r--layouts/_default/limage.html19
1 files changed, 18 insertions, 1 deletions
diff --git a/layouts/_default/limage.html b/layouts/_default/limage.html
index 6208469..49d31cf 100644
--- a/layouts/_default/limage.html
+++ b/layouts/_default/limage.html
@@ -1,4 +1,21 @@
-<div class="col-lg-4 col-sm-6">
+
+{{/* Get the number of columns from config */}}
+{{ $.Scratch.Set "col_lg" "col-lg-4" }}
+{{ with $.Site.Params.projects.nb_columns }}
+ {{ $nb_cols := div 12 (int .) }}
+ {{ $.Scratch.Set "col_lg" (print "col-lg-" $nb_cols) }}
+{{ end }}
+{{ $col_lg := $.Scratch.Get "col_lg" }}
+
+{{ $.Scratch.Set "col_sm" "col-sm-6" }}
+{{ with $.Site.Params.projects.nb_columns_small }}
+ {{ $nb_cols := div 12 (int .) }}
+ {{ $.Scratch.Set "col_sm" (print "col-sm-" $nb_cols) }}
+{{ end }}
+{{ $col_sm := $.Scratch.Get "col_sm" }}
+{{ $class := print $col_lg " " $col_sm }}
+
+<div class="{{ $class }}">
{{ $path := replace .Dir "\\" "/" }}
<a href="/{{ $path }}" class="project-box project-link">
{{ $image_file := or .Params.cover_image .Params.small_image }}