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

home.html « sections « partials « layouts - github.com/2-REC/hugo-myportfolio-theme.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: d9f8a7205d623a4df4b5a92e921983eeeb455793 (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
{{ $params := .Site.Params.home }}
{{ with .Site.Data.home }}
    <section id="home"
        {{ with .background }}
            style="background-image: url('{{ (printf "images/%s" .) | absURL }}');"
        {{ end }}
        >
        <div class="header-content"
            style="
            {{- with $params.width -}}
                --home-width: {{ . }}%;
            {{- end -}}
            {{- if isset $params "offset_h" -}}
                --home-offset-h: {{ $params.offset_h }}%;
            {{- end -}}
            {{- if isset $params "offset_v" -}}
                --home-offset-v: {{ $params.offset_v }}%;
            {{- end -}}
            {{- with $params.text_align -}}
                --home-text-align: {{ . }};
            {{- end -}}
            "
        >
            <div class="header-content-inner">
                {{ with .title }}
                    {{/* TODO: use specific class for title? */}}
                    <h1>{{ . | markdownify  }}</h1>
                {{ end }}
                {{ with .subtitle }}
                    <h2>{{ . | markdownify }}</h2>
                {{ end }}
                {{ if .title }}
                    <hr class="primary">
                {{ end }}
                {{ with .text }}
                    <p>{{ . | markdownify }}</p>
                {{ end }}
                {{ if .button_image }}
                    <a href="#about" class="btn-image page-scroll">
                        <img src={{ .button_image }} />
                    </a>
                {{ else if .button_text }}
                    <a href="#about" class="btn btn-primary page-scroll">
                        {{ .button_text }}<br>
                    </a>
                {{ else if .button_icon }}
                    {{ with .button_icon }}
                        <a href="#about" class="btn-icon btn-primary page-scroll {{ .pack }} {{ .icon }} icon-x6">
                        </a>
                    {{ end }}
                {{ end }}
            </div>
        </div>
    </section>
{{ end }}