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

limage.html « _default « layouts - github.com/2-REC/hugo-myportfolio-theme.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: f165f4cd8df3a37c738bfa9c1a1a1788fbf947cc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55

{{/* 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.Delete "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" }}
{{ $.Scratch.Delete "col_sm" }}

{{ $class := print $col_lg " " $col_sm }}

<div class="{{ $class }}">
    {{ $path := replace .File.Dir "\\" "/" }}
    <a href="/{{ $path }}" class="project-box project-link">
        {{ $image_file := or .Params.cover_image .Params.small_image }}
        {{ if $image_file }}
            {{ $image := .Resources.GetMatch $image_file }}
            {{ with $image }}
                <img src="{{ .Permalink }}" class="img-responsive" alt="{{ .Name }}">
            {{ end }}
        {{ end }}

        <div class="project-box-caption">
            <div class="project-box-caption-content">
                {{ with .Title }}
                    <div class="project-name">
                        {{ . }}
                    </div>
                {{ end }}
                {{ with .Params.subtitle }}
                    <div class="project-category">
                        {{ . }}
                    </div>
                {{ end }}
                {{ if .Params.startDate }}
                    <div class="project-date">
                        From {{ .Params.startDate }}
                        {{ with .Params.endDate }}
                            to {{ . }}
                        {{ end }}
                    </div>
                {{ end }}
            </div>
        </div>
    </a>
</div>