1
0
mirror of https://github.com/alexandrev/xslt-lab.git synced 2026-09-21 13:03:15 +00:00
This commit is contained in:
2025-11-22 13:55:02 +01:00
parent a08c3ab6d6
commit f97b4402c6
7 changed files with 40 additions and 1 deletions
+5
View File
@@ -0,0 +1,5 @@
{{- $client := or .Site.Params.adsense.client (getenv "ADSENSE_CLIENT") -}}
{{- if and $client (ne hugo.Environment "development") -}}
<meta name="google-adsense-account" content="{{ $client }}">
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client={{ $client }}" crossorigin="anonymous"></script>
{{- end -}}
@@ -0,0 +1,15 @@
{{- $client := or .Site.Params.adsense.client (getenv "ADSENSE_CLIENT") -}}
{{- $slot := or .Site.Params.adsense.inArticleSlot (getenv "ADSENSE_INARTICLE_SLOT") -}}
{{- if and $client $slot (ne hugo.Environment "development") -}}
<div class="ad ad-in-article">
<ins class="adsbygoogle"
style="display:block; text-align:center;"
data-ad-layout="in-article"
data-ad-format="fluid"
data-ad-client="{{ $client }}"
data-ad-slot="{{ $slot }}"></ins>
</div>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
{{- end -}}