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

profile.html « home « partials « layouts - github.com/uPagge/uBlogger.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 8b1c49e75ffe48e2e6506733797045eb6a0a0606 (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
{{- $profile := .Site.Params.home.profile -}}
<div class="home-profile">
    {{- $avatar := $profile.avatarURL -}}
    {{- with $profile.gravatarEmail -}}
        {{- $avatar = md5 . | printf "https://www.gravatar.com/avatar/%v?s=240&d=mp" -}}
    {{- end -}}
    {{- if $avatar -}}
        <div class="home-avatar">
            {{- $menus := $.Site.Menus.main | default slice -}}
            {{- with index $menus 0 -}}
                {{- $url := .URL | relLangURL -}}
                {{- with .Page -}}
                    {{- $url = .RelPermalink -}}
                {{- end -}}
                <a href="{{ $url }}"{{ with .Title | default .Name }} title="{{ . }}"{{ end }}{{ if (urls.Parse $url).Host }} rel="noopener noreffer" target="_blank"{{ end }}>
                    {{- dict "Src" $avatar | partial "plugin/image.html" -}}
                </a>
            {{- else -}}
                {{- dict "Src" $avatar | partial "plugin/image.html" -}}
            {{- end -}}
        </div>
    {{- end -}}

    <div class="home-meta">

        {{- with $profile.title -}}
            <h1 class="home-title">
                {{- . | safeHTML -}}
            </h1>
        {{- end -}}

        {{- with $profile.subtitle -}}
            <div class="home-subtitle">
                {{- if $profile.typeit -}}
                    {{- $id := dict "Content" . "Scratch" $.Scratch | partial "function/id.html" -}}
                    <div id="{{ $id }}" class="typeit"></div>
                    {{- dict $id (slice $id) | dict "typeitMap" | merge ($.Scratch.Get "this") | $.Scratch.Set "this" -}}
                {{- else -}}
                    {{- . | safeHTML -}}
                {{- end -}}
            </div>
        {{- end -}}

        {{- with $profile.disclaimer -}}
        <div class="home-disclaimer">
            {{- . | safeHTML -}}
        </div>
        {{- end -}}

        {{- if $profile.social -}}
            <div class="links">
                {{- $socialMap := resources.Get "data/social.yml" | transform.Unmarshal -}}
                {{- $socialArr := slice -}}
                {{- range $key, $value := .Site.Params.social -}}
                    {{- $social := $key | lower | index $socialMap | default dict -}}
                    {{- if $value -}}
                        {{- if reflect.IsMap $value -}}
                            {{- with $value.weight -}}
                                {{- $social = dict "Weight" . | merge $social -}}
                            {{- end -}}
                            {{- with $value.prefix -}}
                                {{- $social = dict "Prefix" . | merge $social -}}
                            {{- end -}}
                            {{- with $value.template -}}
                                {{- $social = dict "Template" . | merge $social -}}
                            {{- end -}}
                            {{- with $value.id -}}
                                {{- $social = dict "Id" . | merge $social -}}
                            {{- end -}}
                            {{- with $value.url -}}
                                {{- $social = dict "Url" . | merge $social -}}
                            {{- end -}}
                            {{- with $value.title -}}
                                {{- $social = dict "Title" . | merge $social -}}
                            {{- end -}}
                            {{- with $value.newtab -}}
                                {{- $social = dict "Newtab" . | merge $social -}}
                            {{- end -}}
                            {{- with $value.icon -}}
                                {{- $social = dict "Icon" . | merge $social -}}
                            {{- end -}}
                        {{- else if ne $value true -}}
                            {{- $social = dict "Id" $value | merge $social -}}
                        {{- end -}}
                        {{- if $social.Icon.Simpleicons -}}
                            {{- $prefix := ($.Scratch.Get "cdn" | default dict).simpleIconsPrefix -}}
                            {{- $social = dict "Prefix" $prefix | dict "Icon" | merge $social -}}
                        {{- end -}}
                        {{- $socialArr = $socialArr | append $social -}}
                    {{- end -}}
                {{- end -}}
                {{- range sort $socialArr "Weight" -}}
                    {{- partial "plugin/social.html" . -}}
                {{- end -}}
            </div>
        {{- end -}}
    </div>
</div>