Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/J-Siu/hugo-theme-sk3.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn, Sing Dao, Siu <john.sd.siu@gmail.com>2022-05-12 08:11:58 +0300
committerJohn, Sing Dao, Siu <john.sd.siu@gmail.com>2022-05-12 08:11:58 +0300
commitca75206111d265118cfc3deb5470220e9257b6b6 (patch)
tree070ece855e89682fea0f627dd9a925458317edce
parent626a43e35ff2520906aaf1ad6018f70a3a1b2caa (diff)
Add adsense_page_level control
-rw-r--r--README.md12
-rw-r--r--config.sample.toml29
-rw-r--r--layouts/partials/adsense.html2
3 files changed, 27 insertions, 16 deletions
diff --git a/README.md b/README.md
index f41d908..dc85ff4 100644
--- a/README.md
+++ b/README.md
@@ -362,6 +362,15 @@ svg_ext = true
adsense_id = ""
```
+- Control page level ads:
+
+ ```toml
+ [Params]
+ adsense_page_level = true
+ ```
+
+ Add above to enable page level ads.
+
#### Google Analytic
- Support Google Analytic UA and GA4
@@ -370,7 +379,8 @@ svg_ext = true
[Params]
googleAnalyticsUA = true
```
- If using GA4, set above to false, or unset.
+
+Only use this if using UA. If using GA4, set above to false, or unset.
#### Twitter Cards / Opengraph
diff --git a/config.sample.toml b/config.sample.toml
index 7d0709f..f5ad2a4 100644
--- a/config.sample.toml
+++ b/config.sample.toml
@@ -12,20 +12,21 @@ paginate = 15
#googleAnalytics = ""
[Params]
-# adsense_id = ""
-# custom_css = ["/css/abc.css", "/css/def.css"]
-# custom_js = ["/js/abc.js", "/js/def.js"]
-# favicon = "/favicon.ico"
-# googleAnalyticsUA = true
-# listlastmod = false
-# mainSections = "post"
-# openToc = false
-# pageinfobox = true
-# pagewidth = "1200px"
-# startdate = "2012-12-02"
-# subtitle = "A Hugo Theme"
-# svg_ext = false
-# user_canonical = false
+# adsense_id = ""
+# adsense_page_level = true
+# custom_css = ["/css/abc.css", "/css/def.css"]
+# custom_js = ["/js/abc.js", "/js/def.js"]
+# favicon = "/favicon.ico"
+# googleAnalyticsUA = true
+# listlastmod = false
+# mainSections = "post"
+# openToc = false
+# pageinfobox = true
+# pagewidth = "1200px"
+# startdate = "2012-12-02"
+# subtitle = "A Hugo Theme"
+# svg_ext = false
+# user_canonical = false
# Fill in following if using opengraph / twitter card
#opengraph = true
diff --git a/layouts/partials/adsense.html b/layouts/partials/adsense.html
index e0c3bf5..cd99408 100644
--- a/layouts/partials/adsense.html
+++ b/layouts/partials/adsense.html
@@ -3,7 +3,7 @@
<script>
(adsbygoogle = window.adsbygoogle || []).push({
google_ad_client: "{{site.Params.adsense_id}}",
- enable_page_level_ads: true
+ enable_page_level_ads: {{site.Params.adsense_page_level | default false}}
});
</script>
{{end}} \ No newline at end of file