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

about.html « sections « partials « layouts - github.com/2-REC/hugo-myportfolio-theme.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 5adf8201a88e2cbb09641e17a8b145a0fa786ddf (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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
{{ "<!-- ABOUT -->" | safeHTML }}
{{ $params := .Site.Params.about }}
{{ with .Site.Data.about }}
  {{ $big_side := 8 }}
  {{ with $params.big_side -}}
    {{ $big_side = . }}
  {{ end }}
  {{ $small_side := sub 12 $big_side }}
  <section class="section" id="about"
    style="
      {{- with .background_image -}}
        --about-bkg-image: url('{{ (printf "images/%s" .) | absURL }}');
      {{- end -}}
      {{- if ne $params.background "full" -}}
        {{- if eq $params.layout "left" -}}
          --about-bkg-width: {{ mul (div $small_side 12.0) 100 }}%;
          --about-bkg-margin-left: {{ mul (div $big_side 12.0) 100 }}%;
          --about-bkg-margin-right: 0;
        {{- else if eq $params.layout "right" -}}
          --about-bkg-width: {{ mul (div $small_side 12.0) 100 }}%;
          --about-bkg-margin-left: 0;
          --about-bkg-margin-right: {{ mul (div $big_side 12.0) 100 }}%;
        {{- end -}}
      {{- end -}}
      {{/* TODO: keep this in 'config'? (should be enough with only in CSS) */}}
      {{- with $params.background_opacity -}}
        --about-bkg-opacity: {{ . }};
      {{- end -}}
      {{- with $params.background_position -}}
        --about-bkg-position: {{ . }};
      {{- end -}}
      {{- with $params.background_size -}}
        --about-bkg-size: {{ . }};
      {{- end -}}
  ">
    <div class="container-fluid">
      <div class="row">
        {{ $title_length := 10 }}
        {{ with $params.title_length }}
          {{ $title_length = . }}
        {{ end }}
        {{ if eq $params.title_align "left" }}
          <div class="col-md-{{ $title_length }} section-title-left">
        {{ else }}
          <div class="col-md-{{ $title_length }} col-md-offset-{{ sub 12 $title_length }} section-title-right">
        {{ end }}
          {{ with .title }}
            <h2 class="section-heading">{{ . }}</h2>
            <hr class="primary light">
          {{ end }}
        </div>
      </div>
    </div>
    <div class="container-fluid">
      <div class="row">
        {{ if eq $params.layout "right" }}
          <div class="col-xs-12 col-md-{{ $small_side }}"></div>
        {{ end }}
        {{ if and (ne $params.layout "left") (ne $params.layout "right") }}
          {{/* ~Hack to add space outside (offset left) */}}
          <div class="col-xs-12 col-md-offset-1 col-md-{{ sub $small_side 1 }}">
        {{ else }}
          <div class="col-xs-12 col-md-{{ $big_side }}">
        {{ end }}
            <div class="profile">
              {{ with .avatar }}
                <img class="portrait" title="avatar: {{ . }}" src="{{ printf "/images/%s" .}}">
              {{ end }}
              {{ with .short_text }}
                <div class="text-primary short-text">
                  <p>{{ . | markdownify }}</p>
                </div>
              {{ end }}
            </div>
        {{ if .long_text }}
          {{ if and (ne $params.layout "left") (ne $params.layout "right") }}
          </div>
          {{/* ~Hack to add space outside (shorter right) */}}
{{/*
          <div class="col-xs-12 col-md-{{ sub $big_side 1 }} text-tertiary long-text">
*/}}
          <div class="col-xs-12 col-md-{{ sub $big_side 1 }}">
            <div class="text-tertiary long-text">
            <p>{{ .long_text | markdownify }}</p>
            </div>
          </div>
          {{ else }}
            <div>
              <p></p>
            </div>
            <div class="text-tertiary long-text">
              <p>{{ .long_text | markdownify }}</p>
            </div>
          </div>
          {{ end }}
        {{ end }}
        {{ if eq $params.layout "left" }}
          <div class="col-xs-12 col-md-{{ $small_side }}"></div>
        {{ end }}
      </div>
    </div>
  </section>
{{ end }}