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

limage.html « partials « layouts - github.com/2-REC/hugo-myportfolio-theme.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 9995503874098778393b2ed4df7eace61f62ee09 (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 */}}
{{ $col_lg := "col-lg-2" }}
{{ $col_sm := "col-sm-3" }}
{{ $col_xs := "col-xs-6" }}
{{ with .data }}
    {{ with .nb_columns }}
        {{ $nb_cols := div 12 (int .) }}
        {{ $col_lg = print "col-lg-" $nb_cols }}
    {{ end }}
    {{ with .nb_columns_small }}
        {{ $nb_cols := div 12 (int .) }}
        {{ $col_sm = print "col-sm-" $nb_cols }}
    {{ end }}
    {{ with .nb_columns_xsmall }}
        {{ $nb_cols := div 12 (int .) }}
        {{ $col_xs = print "col-xs-" $nb_cols }}
    {{ end }}
{{ end }}
{{ $class := print $col_lg " " $col_sm " " $col_xs }}
<div class="{{ $class }}">
    {{ $path := replace .context.File.Dir "\\" "/" }}
    <a href="/{{ $path }}" class="project-box project-link">
        {{ $image_file := or .context.Params.cover_image .context.Params.small_image }}
        {{ if $image_file }}
            {{ $image := .context.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 .context.Title }}
                    <div class="project-name">
                        {{ . }}
                    </div>
                {{ end }}
                {{ with .context.Params.subtitle }}
                    <div class="project-category">
                        {{ . }}
                    </div>
                {{ end }}
                {{ with .context.Params.subtitle2 }}
                    <div class="project-category2">
                        {{ . }}
                    </div>
                {{ end }}
                {{ if .context.Params.startDate }}
                    <div class="project-date">
                        {{ partial "time-period.html" (dict "startDate" .context.Params.startDate "endDate" .context.Params.endDate) }}
                    </div>
                {{ end }}
            </div>
        </div>
    </a>
</div>