mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-31 22:41:53 +02:00
committed by
Bjørn Erik Pedersen
parent
1f5a15aba0
commit
8de4ffb294
@@ -9,7 +9,7 @@ Encodes the given text into a QR code using the specified options and renders th
|
||||
@param {string} [class] The class attribute of the img element.
|
||||
@param {string} [id] The id attribute of the img element.
|
||||
@param {string} [title] The title attribute of the img element.
|
||||
@param {string} [loading] The loading attribute of the img element, one of lazy, or eager.
|
||||
@param {string} [loading] The loading attribute of the img element, one of lazy or eager.
|
||||
|
||||
@returns {template.HTML}
|
||||
|
||||
@@ -49,7 +49,6 @@ Encodes the given text into a QR code using the specified options and renders th
|
||||
{{- $title := or (.Get "title") "" }}
|
||||
{{- $loading := or (.Get "loading") "" }}
|
||||
|
||||
|
||||
{{- /* Validate arguments. */}}
|
||||
{{- $errors := false}}
|
||||
{{- if not $text }}
|
||||
|
@@ -1,5 +1,5 @@
|
||||
{{- warnf "The \"twitter\", \"tweet\", and \"twitter_simple\" shortcodes were deprecated in v0.142.0 and will be removed in a future release. Please use the \"x\" shortcode instead." }}
|
||||
{{- $pc := .Page.Site.Config.Privacy.Twitter -}}
|
||||
{{- $pc := site.Config.Privacy.Twitter -}}
|
||||
{{- if not $pc.Disable -}}
|
||||
{{- if $pc.Simple -}}
|
||||
{{- template "_internal/shortcodes/twitter_simple.html" . -}}
|
||||
@@ -7,7 +7,7 @@
|
||||
{{- $id := or (.Get "id") "" -}}
|
||||
{{- $user := or (.Get "user") "" -}}
|
||||
{{- if and $id $user -}}
|
||||
{{- template "render-tweet" (dict "id" $id "user" $user "dnt" $pc.EnableDNT "name" .Name "position" .Position) -}}
|
||||
{{- template "render-tweet" (dict "id" $id "user" $user "dnt" $pc.EnableDNT "ctx" .) -}}
|
||||
{{- else -}}
|
||||
{{- errorf "The %q shortcode requires two named parameters: user and id. See %s" .Name .Position -}}
|
||||
{{- end -}}
|
||||
@@ -24,7 +24,7 @@
|
||||
{{- else with .Value -}}
|
||||
{{- (. | transform.Unmarshal).html | safeHTML -}}
|
||||
{{- else -}}
|
||||
{{- warnidf "shortcode-twitter-getremote" "The %q shortcode was unable to retrieve the remote data. See %s" .name .position -}}
|
||||
{{- warnidf "shortcode-twitter-getremote" "The %q shortcode was unable to retrieve the remote data. See %s" $.ctx.Name $.ctx.Position -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
@@ -23,7 +23,7 @@
|
||||
{{- end }}
|
||||
{{- (. | transform.Unmarshal).html | safeHTML -}}
|
||||
{{- else -}}
|
||||
{{- warnidf "shortcode-twitter-simple-getremote" "The %q shortcode was unable to retrieve the remote data. See %s" .ctx.Name .ctx.Position -}}
|
||||
{{- warnidf "shortcode-twitter-simple-getremote" "The %q shortcode was unable to retrieve the remote data. See %s" $.ctx.Name $.ctx.Position -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
@@ -1,4 +1,4 @@
|
||||
{{- $pc := .Page.Site.Config.Privacy.Vimeo -}}
|
||||
{{- $pc := site.Config.Privacy.Vimeo -}}
|
||||
{{- if not $pc.Disable -}}
|
||||
{{- if $pc.Simple -}}
|
||||
{{ template "_internal/shortcodes/vimeo_simple.html" . }}
|
||||
@@ -11,4 +11,4 @@
|
||||
</div>
|
||||
{{ end }}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{{- $pc := .Page.Site.Config.Privacy.Vimeo -}}
|
||||
{{- $pc := site.Config.Privacy.Vimeo -}}
|
||||
{{- if not $pc.Disable -}}
|
||||
{{- $ctx := dict "page" .Page "pc" $pc "name" .Name "position" .Position }}
|
||||
{{- $ctx := dict "ctx" . }}
|
||||
{{- if .IsNamedParams -}}
|
||||
{{- with .Get "id" -}}
|
||||
{{- $ctx = merge $ctx (dict "id" . "class" ($.Get "class")) -}}
|
||||
@@ -19,7 +19,7 @@
|
||||
{{- end -}}
|
||||
|
||||
{{- define "render-vimeo" -}}
|
||||
{{- $dnt := cond .pc.EnableDNT 1 0 -}}
|
||||
{{- $dnt := cond site.Config.Privacy.Vimeo.EnableDNT 1 0 -}}
|
||||
{{- $url := urls.JoinPath "https://vimeo.com" .id -}}
|
||||
{{- $query := querify "url" $url "dnt" $dnt -}}
|
||||
{{- $request := printf "https://vimeo.com/api/oembed.json?%s" $query -}}
|
||||
@@ -32,7 +32,7 @@
|
||||
{{- with $.class -}}
|
||||
{{- $class = printf "%s %s" "s_video_simple" . -}}
|
||||
{{- else -}}
|
||||
{{ template "__h_simple_css" $.page }}
|
||||
{{ template "__h_simple_css" $.ctx.Page }}
|
||||
{{- end -}}
|
||||
{{- $thumbnail := .thumbnail_url -}}
|
||||
{{- $original := $thumbnail | replaceRE "(_.*\\.)" "." -}}
|
||||
@@ -40,13 +40,13 @@
|
||||
<a href="{{ .provider_url }}{{ .video_id }}" rel="noopener" target="_blank">
|
||||
<img src="{{ $thumbnail }}" srcset="{{ $thumbnail }} 1x, {{ $original }} 2x" alt="{{ .title }}">
|
||||
<div class="play">
|
||||
{{ template "__h_simple_icon_play" $.page }}
|
||||
{{ template "__h_simple_icon_play" $.ctx.Page }}
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
{{- end -}}
|
||||
{{- else -}}
|
||||
{{- warnidf "shortcode-vimeo-simple" "The %q shortcode was unable to retrieve the remote data. See %s" .name .position -}}
|
||||
{{- warnidf "shortcode-vimeo-simple" "The %q shortcode was unable to retrieve the remote data. See %s" $.ctx.Name $.ctx.Position -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
@@ -1,4 +1,4 @@
|
||||
{{- $pc := .Page.Site.Config.Privacy.X -}}
|
||||
{{- $pc := site.Config.Privacy.X -}}
|
||||
{{- if not $pc.Disable -}}
|
||||
{{- if $pc.Simple -}}
|
||||
{{- template "_internal/shortcodes/x_simple.html" . -}}
|
||||
@@ -6,7 +6,7 @@
|
||||
{{- $id := or (.Get "id") "" -}}
|
||||
{{- $user := or (.Get "user") "" -}}
|
||||
{{- if and $id $user -}}
|
||||
{{- template "render-x" (dict "id" $id "user" $user "dnt" $pc.EnableDNT "name" .Name "position" .Position) -}}
|
||||
{{- template "render-x" (dict "id" $id "user" $user "dnt" $pc.EnableDNT "ctx" .) -}}
|
||||
{{- else -}}
|
||||
{{- errorf "The %q shortcode requires two named parameters: user and id. See %s" .Name .Position -}}
|
||||
{{- end -}}
|
||||
@@ -23,7 +23,7 @@
|
||||
{{- else with .Value -}}
|
||||
{{- (. | transform.Unmarshal).html | safeHTML -}}
|
||||
{{- else -}}
|
||||
{{- warnidf "shortcode-x-getremote" "The %q shortcode was unable to retrieve the remote data. See %s" .name .position -}}
|
||||
{{- warnidf "shortcode-x-getremote" "The %q shortcode was unable to retrieve the remote data. See %s" $.ctx.Name $.ctx.Position -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
@@ -22,7 +22,7 @@
|
||||
{{- end }}
|
||||
{{- (. | transform.Unmarshal).html | safeHTML -}}
|
||||
{{- else -}}
|
||||
{{- warnidf "shortcode-x-simple-getremote" "The %q shortcode was unable to retrieve the remote data. See %s" .ctx.Name .ctx.Position -}}
|
||||
{{- warnidf "shortcode-x-simple-getremote" "The %q shortcode was unable to retrieve the remote data. See %s" $.ctx.Name $.ctx.Position -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
Reference in New Issue
Block a user