diff options
author | Asur <asur@asurbernardo.com> | 2020-07-24 19:14:38 +0300 |
---|---|---|
committer | Asur <asur@asurbernardo.com> | 2020-07-24 19:14:38 +0300 |
commit | 45c82e6e25d22371106dc9801f1503a91700ad49 (patch) | |
tree | eb0ce154837e39f43a9a5a0ad094184883b37b63 | |
parent | c7951b316a5bd4d475fd04e5d1104752bb0a3623 (diff) |
Add the possibility to configure AMP auto-ads feature
-rw-r--r-- | layouts/_default/baseof.html | 5 | ||||
-rw-r--r-- | layouts/partials/head/amp-components.html | 8 |
2 files changed, 12 insertions, 1 deletions
diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index dce6430..a9d0800 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -4,6 +4,11 @@ {{- partial "head/base.html" . -}} </head> <body> + {{ with .Site.Params.AdsensePublisher }} + {{ if eq $.Site.Params.AutoAdsEnabled true }} + <amp-auto-ads type="adsense" data-ad-client="{{ . }}"></amp-auto-ads> + {{ end }} + {{ end }} {{- partial "page/install-sw.html" . -}} {{- partial "page/analytics.html" . -}} {{- partial "structured-data/base.html" . -}} diff --git a/layouts/partials/head/amp-components.html b/layouts/partials/head/amp-components.html index 267e83d..b60f15c 100644 --- a/layouts/partials/head/amp-components.html +++ b/layouts/partials/head/amp-components.html @@ -17,4 +17,10 @@ {{ end }} {{ end }} {{ end }} -<script async custom-template="amp-mustache" src="https://cdn.ampproject.org/v0/amp-mustache-0.2.js"></script>
\ No newline at end of file +<script async custom-template="amp-mustache" src="https://cdn.ampproject.org/v0/amp-mustache-0.2.js"></script> + +{{ with .Site.Params.AdsensePublisher }} + {{ if eq $.Site.Params.AutoAdsEnabled true }} + <script async custom-element="amp-auto-ads" src="https://cdn.ampproject.org/v0/amp-auto-ads-0.1.js"></script> + {{ end }} +{{ end }}
\ No newline at end of file |