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-07-24 19:35:31 +0300
committerAsur <asur@asurbernardo.com>2020-07-24 19:35:31 +0300
commit9824512d4eed990c75e2d223a8593c94891a7ce5 (patch)
treec73d5cc706138d49b57af1b01d5a7af14a54f73b
parent45c82e6e25d22371106dc9801f1503a91700ad49 (diff)
Simplify adsense ad shortcode
-rw-r--r--layouts/partials/shortcodes/amp-adsense.html33
1 files changed, 7 insertions, 26 deletions
diff --git a/layouts/partials/shortcodes/amp-adsense.html b/layouts/partials/shortcodes/amp-adsense.html
index dc1c817..270abdb 100644
--- a/layouts/partials/shortcodes/amp-adsense.html
+++ b/layouts/partials/shortcodes/amp-adsense.html
@@ -1,34 +1,15 @@
-{{ if isset $.Site.Params "adsensepublisher" }}
- {{ with .Params }}
+{{ with $.Site.Params.AdsensePublisher }}
<fieldset class="ad">
<legend><strong>#ad</strong></legend>
<amp-ad type="adsense"
- {{ with .class }} class="{{ . }}"{{ end }}
- {{ with .alt }} alt="{{ . }}"{{ end }}
- {{ with .width }} width="{{ . }}"{{ end }}
- {{ with .height }} height="{{ . }}"{{ end }}
- {{ with .layout }} layout="{{ . }}"{{ end }}
- {{ with .slot }} data-ad-slot="{{ . }}" {{ end }}
+ {{ with $.Params.Class }} class="{{ . }}"{{ end }}
+ {{ with $.Params.Alt }} alt="{{ . }}"{{ end }}
+ {{ with $.Params.Width }} width="{{ . }}"{{ end }}
+ {{ with $.Params.Height }} height="{{ . }}"{{ end }}
+ {{ with $.Params.Layout }} layout="{{ . }}"{{ end }}
+ {{ with $.Params.Slot }} data-ad-slot="{{ . }}" {{ end }}
data-ad-client="{{ $.Site.Params.adsensePublisher }}">
<div class="ad__fallback" fallback><p>{{ i18n "noAd" }}</p></div>
</amp-ad>
</fieldset>
- {{ end }}
-{{ else }}
- {{ if isset . "context" }}
- {{ $publisher := .context.Site.Params.adsensePublisher }}
- <fieldset class="ad">
- <legend><strong>#ad</strong></legend>
- <amp-ad type="adsense"
- {{ with .class }} class="{{ . }}"{{ end }}
- {{ with .alt }} alt="{{ . }}"{{ end }}
- {{ with .width }} width="{{ . }}"{{ end }}
- {{ with .height }} height="{{ . }}"{{ end }}
- {{ with .layout }} layout="{{ . }}"{{ end }}
- {{ with .slot }} data-ad-slot="{{ . }}" {{ end }}
- data-ad-client="{{ $publisher }}">
- <div class="ad__fallback" fallback><p>{{ i18n "noAd" }}</p></div>
- </amp-ad>
- </fieldset>
- {{ end }}
{{ end }} \ No newline at end of file