diff --git a/README.md b/README.md index 3ae4cce..574054b 100644 --- a/README.md +++ b/README.md @@ -243,6 +243,24 @@ Even better...look what happens when you go to the full posting: We now have a nice section for author details at the bottom which pulls in a lot of the metadata you created earlier in the site's `config.yml`. Looking good!! +## Google analytics configuration + +You can add the Google Analytics script to your posts and pages by defining the `googleAnalytics` variable in your config.yaml file: + +```yaml +--- +baseurl: http://www.bayactive.org +languageCode: en-us +title: BayActive +googleAnalytics: "UA-12345-6" +params: + cover: /img/cover.jpg + logo: /img/logo.svg + description: Hikes, bikes & rides in the bay +... +--- +``` + ## Attribution Hasper was originally [a fork](https://github.com/dencold/hugo-theme-casper) of the [hugo-theme-casper](https://github.com/vjeantet/hugo-theme-casper). However, the original author has not been responding to [pull requests](https://github.com/vjeantet/hugo-theme-casper/pull/41). Hasper now lives as its own separate repository, for a full list of changes from the original theme, consult the [CHANGELOG](CHANGELOG.md). diff --git a/config-example.yaml b/config-example.yaml index 000dc8c..dd50652 100644 --- a/config-example.yaml +++ b/config-example.yaml @@ -31,7 +31,6 @@ params: hideHUGOSupport: true # by default, hasper puts a nod to hugo in footer, set to true if you wish to hide githubName: "" # if set, hasper will display github logo with link above site title twitterName: "bayactive" # if set, hasper will display twitter logo with link above site title -# googleAnalyticsUserID: "YOUR_GA_ID_HERE" # TODO: check on this config. I think there is a googleAnalytics in hugo variables that is canonical # RSSLink: "http://feeds.feedburner.com/..." # TODO: how is this different from hugo variable config? Optional RSS-Link, if not provided it defaults to the standard index.xml # there are sharing links at the bottom of every post. all options are listed below. diff --git a/layouts/partials/scripts.html b/layouts/partials/scripts.html index 8fdd59b..f4caeb4 100644 --- a/layouts/partials/scripts.html +++ b/layouts/partials/scripts.html @@ -2,4 +2,5 @@ +{{ template "_internal/google_analytics.html" . }}