diff options
-rw-r--r-- | README.md | 2 | ||||
-rw-r--r-- | exampleSite/config.toml | 4 | ||||
-rw-r--r-- | layouts/partials/head.html | 9 |
3 files changed, 14 insertions, 1 deletions
@@ -68,7 +68,7 @@ Inside the folder of your Hugo site run: $ git submodule update --remote --merge ``` -## ⚙️ Configration +## ⚙️ Configuration ### 🎨 Favicon diff --git a/exampleSite/config.toml b/exampleSite/config.toml index 72e22b7..4ba95b6 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -29,6 +29,10 @@ paginate = 10 # googleAnalyticsTid = "UA-000000000-0" # googleAnalyticsRoute = "https://*.*.workers.dev/" + # Google AdSense + # The AdSense code will be inserted between the head tags of your site. + # googleAdsense = "0000000000000000" + # Word counter and read time indicator in post metadata showWordCounter = true showReadTime = false diff --git a/layouts/partials/head.html b/layouts/partials/head.html index 0603c4d..b953cd8 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -41,6 +41,15 @@ <link rel="stylesheet" href="{{ "/assets/css/fuji.min.css" | relURL }}" /> {{ end }} +{{ if .Site.Params.googleAdsense }} +<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> +<script> + (adsbygoogle = window.adsbygoogle || []).push({ + enable_page_level_ads: true, + google_ad_client: "ca-pub-{{.Site.Params.googleAdsense}}", + }); +</script> +{{ end}} {{ if .Params.playerURL }} <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/aplayer@1.10.1/dist/APlayer.min.css" /> {{ end }} |