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

profile.html « home « partials « layouts - github.com/dillonzq/LoveIt.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 18ce94dc20edb9d5c24e6f95f210d313d6b5c3f7 (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
<div class="home-profile">
    {{- $avatar := .Site.Params.home.profile.avatarURL -}}
    {{- with .Site.Params.home.profile.gravatarEmail -}}
        {{- $avatar = md5 . | printf "https://www.gravatar.com/avatar/%s?s=240&d=mp" -}}
    {{- end -}}
    {{- with $avatar -}}
        <div class="home-avatar">
            <a href="/posts" title="{{ T `home` }}">
                {{- dict "src" . "alt" (T "home") | partial "plugin/image.html" -}}
            </a>
        </div>
    {{- end -}}

    {{- with .Site.Params.home.profile.subtitle -}}
        <h2 class="home-subtitle">
            {{- if $.Site.Params.home.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 -}}
                {{- . -}}
            {{- end -}}
        </h2>
    {{- end -}}

    {{- if .Site.Params.home.profile.social -}}
        <div class="social-links">
            {{- $socialMap := resources.Get "data/social.yaml" | transform.Unmarshal -}}
            {{- $socialArr := slice -}}
            {{- range $key, $value := .Site.Params.social -}}
                {{- $social := $key | lower | index $socialMap | default dict -}}
                {{- if $value -}}
                    {{- if reflect.IsMap $value -}}
                        {{- $social = $value | merge $social -}}
                    {{- 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 -}}

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