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

github.com/asurbernardo/amperage.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAsur <asur@asurbernardo.com>2020-02-17 15:30:40 +0300
committerAsur <asur@asurbernardo.com>2020-02-17 15:30:40 +0300
commit5104710d4bef99d8865bb6f12c5c97b9a288222f (patch)
tree606082c7f0e40efd052e05ce8ab865119c2c5a6f
parentbc831987da667a56ff3da1795bcd97327f9fff57 (diff)
Adapt gif and video shortcodes to use resources
-rw-r--r--layouts/partials/shortcodes/amp-gif.html19
-rw-r--r--layouts/partials/shortcodes/amp-video.html19
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