hugo-PaperMod/layouts/partials/templates/adsense.html

6 lines
363 B
HTML
Raw Normal View History

2023-12-03 16:18:59 +01:00
{{ $adsenseEnabled := (and .Site.Params "adsense" (ne .Params.disableAdsense true) ) }}
{{ $adsenseAllowedOnPage := (ne .Kind "404" )}}
{{- if (and $adsenseEnabled $adsenseAllowedOnPage) }}
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client={{- .Site.Params.adsense.clientID -}}" crossorigin="anonymous"></script>
{{- end }}