diff options
author | guangmean <angularcorp@outlook.com> | 2019-01-09 06:01:21 +0300 |
---|---|---|
committer | guangmean <angularcorp@outlook.com> | 2019-01-09 06:01:21 +0300 |
commit | d14f9e96e1b18f56777411232db645a55baeaed5 (patch) | |
tree | 049edb728ae26fad199687ca7dc6c2d869dd3d4f | |
parent | ab791178af8754d85600a5d0464afc527850d732 (diff) |
Google Adsense
Add Google Adsense auth logic
-rw-r--r-- | README.md | 5 | ||||
-rw-r--r-- | layouts/partials/head.html | 9 |
2 files changed, 12 insertions, 2 deletions
@@ -28,14 +28,15 @@ git clone https://github.com/guangmean/Niello.git themes/Niello This is an example config.toml file: ```toml -baseURL = "http://example.org/" +baseURL = "https://www.angularcorp.com/" languageCode = "en-us" -title = "New Hugo Theme - Diello" +title = "Application Deveopment" staticDir = ["static", "themes/Niello/static"] [params] copyright = "© 2019 by guangmean. All Rights Reserved." +google_ad_client = "ca-pub-******" ``` # Demo diff --git a/layouts/partials/head.html b/layouts/partials/head.html index f55644c..f574d84 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -9,4 +9,13 @@ <link rel="stylesheet" href="{{.Site.BaseURL | relLangURL}}css/normalize.css"> <link rel="stylesheet" href="{{.Site.BaseURL | relLangURL}}css/main.css"> <link rel="stylesheet" href="{{.Site.BaseURL | relLangURL}}css/diello.css"> + {{ if .Site.Params.google_ad_client }} + <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> + <script> + (adsbygoogle = window.adsbygoogle || []).push({ + google_ad_client: "{{ .Site.Params.google_ad_client }}", + enable_page_level_ads: true + }); + </script> + {{ end }} </head> |