diff options
author | Asur <asur@asurbernardo.com> | 2020-02-17 15:30:40 +0300 |
---|---|---|
committer | Asur <asur@asurbernardo.com> | 2020-02-17 15:30:40 +0300 |
commit | 5104710d4bef99d8865bb6f12c5c97b9a288222f (patch) | |
tree | 606082c7f0e40efd052e05ce8ab865119c2c5a6f | |
parent | bc831987da667a56ff3da1795bcd97327f9fff57 (diff) |
Adapt gif and video shortcodes to use resources
-rw-r--r-- | layouts/partials/shortcodes/amp-gif.html | 19 | ||||
-rw-r--r-- | layouts/partials/shortcodes/amp-video.html | 19 |
2 files changed, 22 insertions, 16 deletions
diff --git a/layouts/partials/shortcodes/amp-gif.html b/layouts/partials/shortcodes/amp-gif.html index 705c960..f4a61a8 100644 --- a/layouts/partials/shortcodes/amp-gif.html +++ b/layouts/partials/shortcodes/amp-gif.html @@ -1,8 +1,11 @@ -<amp-anim - {{ with .class }} class="{{ . }}"{{ end }} - {{ with .alt }} alt="{{ . }}"{{ end }} - {{ with .width }} width="{{ . }}"{{ end }} - {{ with .height }} height="{{ . }}"{{ end }} - {{ with .layout }} layout="{{ . }}"{{ end }} - {{ with .src }} src="{{ . | absURL }}"{{ end }}> -</amp-anim>
\ No newline at end of file +{{ $resource := resources.Get .src }} +{{ with $resource }} + <amp-anim + {{ with $.class }} class="{{ . }}"{{ end }} + {{ with $.alt }} alt="{{ . }}"{{ end }} + {{ with $.width }} width="{{ . }}"{{ end }} + {{ with $.height }} height="{{ . }}"{{ end }} + {{ with $.layout }} layout="{{ . }}"{{ end }} + src="{{ .Permalink | absURL }}"> + </amp-anim> +{{ end }}
\ No newline at end of file diff --git a/layouts/partials/shortcodes/amp-video.html b/layouts/partials/shortcodes/amp-video.html index ea2c7d4..633c5f5 100644 --- a/layouts/partials/shortcodes/amp-video.html +++ b/layouts/partials/shortcodes/amp-video.html @@ -1,8 +1,11 @@ -<amp-video controls - {{ with .class }} class="{{ . }}"{{ end }} - {{ with .alt }} alt="{{ . }}"{{ end }} - {{ with .width }} width="{{ . }}"{{ end }} - {{ with .height }} height="{{ . }}"{{ end }} - {{ with .layout }} layout="{{ . }}"{{ end }} - {{ with .src }} src="{{ . | absURL }}"{{ end }}> -</amp-video>
\ No newline at end of file +{{ $resource := resources.Get .src }} +{{ with $resource }} + <amp-video controls + {{ with $.class }} class="{{ . }}"{{ end }} + {{ with $.alt }} alt="{{ . }}"{{ end }} + {{ with $.width }} width="{{ . }}"{{ end }} + {{ with $.height }} height="{{ . }}"{{ end }} + {{ with $.layout }} layout="{{ . }}"{{ end }} + src="{{ .Permalink | absURL }}"> + </amp-video> +{{ end }}
\ No newline at end of file |