|
1 | | -{{- $pc := .Page.Site.Config.Privacy.Vimeo -}} |
| 1 | +{{- $pc := site.Config.Privacy.Vimeo -}} |
2 | 2 | {{- if not $pc.Disable -}} |
3 | | - {{- $ctx := dict "page" .Page "pc" $pc "name" .Name "position" .Position }} |
| 3 | + {{- $ctx := dict "ctx" . }} |
4 | 4 | {{- if .IsNamedParams -}} |
5 | 5 | {{- with .Get "id" -}} |
6 | 6 | {{- $ctx = merge $ctx (dict "id" . "class" ($.Get "class")) -}} |
|
19 | 19 | {{- end -}} |
20 | 20 |
|
21 | 21 | {{- define "render-vimeo" -}} |
22 | | - {{- $dnt := cond .pc.EnableDNT 1 0 -}} |
| 22 | + {{- $dnt := cond site.Config.Privacy.Vimeo.EnableDNT 1 0 -}} |
23 | 23 | {{- $url := urls.JoinPath "https://vimeo.com" .id -}} |
24 | 24 | {{- $query := querify "url" $url "dnt" $dnt -}} |
25 | 25 | {{- $request := printf "https://vimeo.com/api/oembed.json?%s" $query -}} |
|
32 | 32 | {{- with $.class -}} |
33 | 33 | {{- $class = printf "%s %s" "s_video_simple" . -}} |
34 | 34 | {{- else -}} |
35 | | - {{ template "__h_simple_css" $.page }} |
| 35 | + {{ template "__h_simple_css" $.ctx.Page }} |
36 | 36 | {{- end -}} |
37 | 37 | {{- $thumbnail := .thumbnail_url -}} |
38 | 38 | {{- $original := $thumbnail | replaceRE "(_.*\\.)" "." -}} |
39 | 39 | <div class="{{ $class }}"> |
40 | 40 | <a href="{{ .provider_url }}{{ .video_id }}" rel="noopener" target="_blank"> |
41 | 41 | <img src="{{ $thumbnail }}" srcset="{{ $thumbnail }} 1x, {{ $original }} 2x" alt="{{ .title }}"> |
42 | 42 | <div class="play"> |
43 | | - {{ template "__h_simple_icon_play" $.page }} |
| 43 | + {{ template "__h_simple_icon_play" $.ctx.Page }} |
44 | 44 | </div> |
45 | 45 | </a> |
46 | 46 | </div> |
47 | 47 | {{- end -}} |
48 | 48 | {{- else -}} |
49 | | - {{- warnidf "shortcode-vimeo-simple" "The %q shortcode was unable to retrieve the remote data. See %s" .name .position -}} |
| 49 | + {{- warnidf "shortcode-vimeo-simple" "The %q shortcode was unable to retrieve the remote data. See %s" $.ctx.Name $.ctx.Position -}} |
50 | 50 | {{- end -}} |
51 | 51 | {{- end -}} |
52 | 52 | {{- end -}} |
0 commit comments