blob: a31e9054305c4f89ff06d64170cd7676ef25e9a6 (
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
|
{{ $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 -}}
">
{{ with .title }}
{{ partial "title-bar.html" (dict "title" . "align" $params.title_align "length" $params.title_length) }}
{{ end }}
<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 }}
|