EmielH / tale-hugo

A port of the Tale theme for Hugo. Tale is a minimal theme curated for storytellers.
https://themes.gohugo.io/tale-hugo/
MIT License
248 stars 121 forks source link

Add support for Google Analytics #49

Closed elessar-ch closed 3 years ago

elessar-ch commented 3 years ago

This PR introduces Google Analytics to tale using Hugo's provided async [https://gohugo.io/templates/internal#google-analytics](internal template). Google Analytics is added to the top of the head tag as suggested by https://developers.google.com/analytics/devguides/collection/analyticsjs.

If the googleAnalytics key is added to the config.toml, the template renders the code for Google Analytics, otherwise it will be left out.

This resolves issue #48.

EmielH commented 3 years ago

Thank you so much for this addition! Looks very useful.