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

person.json « assets - github.com/kdevo/osprey-delight.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 51c8663efa09508fd5dcd05f15bd3fc46819b949 (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
{{ $base := dict 
    "@context" "http://www.schema.org"
    "@type" "Person"
    "@id" .Site.BaseURL 
    "name" .Site.Params.author 
    "url" .Site.BaseURL 
    "description" .Site.Params.Description }}
{{ with .Site.Params.Feat.structuredDataGitHubUser }}
    {{ with (getJSON "https://api.github.com/users/" .) }}
        {{ $github := dict 
            "image" .avatar_url 
            "email" .email 
            "address" .location }}
        {{ if ne .login .Site.Params.author }}
        {{ $github = merge (dict "alternateName" .login) $github }}
        {{ end }}

        {{ $affiliation := slice }}
        {{ with (getJSON .organizations_url) }}
            {{ range $i, $org := . -}}
                {{ with (getJSON .url) -}}
                    {{ $org := dict 
                        "@type" "Organization" 
                        "name" .name
                        "sameAs" (slice .blog .html_url) }}
                    {{ $affiliation = append $org $affiliation }}
                {{ end }}
            {{- end }}
        {{- end }}
        {{ $github = merge (dict "affiliation" $affiliation) $github }}
        {{ $base = merge $github $base }}
    {{ end }}
{{ end }}
{{ $sameAs := slice }}
{{ range $i, $url := .Site.Params.Social -}}
    {{ $sameAs = append .url $sameAs }}
{{- end }}
{{ $base = merge (dict "sameAs" $sameAs) $base }}
{{ jsonify $base }}