forked from gethugothemes/hugo-modules
-
Notifications
You must be signed in to change notification settings - Fork 0
adsense
Victor González-Pacheco edited this page Apr 17, 2025
·
1 revision
Add the following code to your module list in the config/_default/module.toml file.
[[imports]]
path = "github.com/gethugothemes/hugo-modules/adsense"Add this configuration to your config/_default/params.toml file.
# google adsense, see https://www.google.com/adsense/
google_adsense = "" # example: ca-pub-XXXXXXXXXXCall it, as a partial in your script.html file.
<!-- google adsense -->
{{ partialCached "adsense-script.html" . }}If you want to use it in some specific location, then call this partial there.
{{ partial "adsense" (dict "Slot" "YOUR_SLOT_ID" "Format" "auto") }}If you want to use it in the markdown file, then call this shortcode in the markdown file.
{{< adsense slot="YOUR_SLOT_ID" format="auto" >}}