add adsense option

This commit is contained in:
~m
2023-12-03 22:18:59 +07:00
parent b288ede80c
commit cfb5c01418
12 changed files with 58 additions and 0 deletions

View File

@ -0,0 +1,6 @@
{{ $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 }}