diff options
author | DSRKafuU | 2020-06-15 14:26:33 +0800 |
---|---|---|
committer | GitHub | 2020-06-15 14:26:33 +0800 |
commit | f1a700fe3788a939e2f4a2049abd580c3465e4e1 (patch) | |
tree | 8784324472b317dd4204f6620583add19cdf1956 | |
parent | d0569100c68fc2dd9c7fae4d91915fd49da8d71f (diff) | |
parent | a27de2dabacb3b3ecddcefb90b893cc9c99fcfcf (diff) | |
download | hugo-theme-fuji-f1a700fe3788a939e2f4a2049abd580c3465e4e1.tar.gz hugo-theme-fuji-f1a700fe3788a939e2f4a2049abd580c3465e4e1.tar.bz2 hugo-theme-fuji-f1a700fe3788a939e2f4a2049abd580c3465e4e1.zip |
Merge pull request #30 from hjiawei/google-adsense
Add preliminary Google AdSense support
-rw-r--r-- | README.md | 2 | ||||
-rw-r--r-- | exampleSite/config.toml | 4 | ||||
-rw-r--r-- | layouts/partials/head.html | 4 |
3 files changed, 9 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 e93a58a..c68d082 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -32,6 +32,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 6470262..88f398f 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -41,6 +41,10 @@ <link rel="stylesheet" href="{{ "/assets/css/fuji.min.css" | relURL }}" /> {{ end }} +{{ with .Site.Params.googleAdsense }} +<script async data-ad-client="ca-pub-{{ . }}" src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> +{{ end}} + {{ if .Params.player }} <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/aplayer@1.10.1/dist/APlayer.min.css" /> {{ end }} |