lukeorth / poison

Professional Hugo theme for dev bloggers. Based on Mdo's classic Hyde theme.
https://poison.lukeorth.com
GNU General Public License v3.0
198 stars 98 forks source link

Updates #126

Closed jnonino closed 12 months ago

jnonino commented 1 year ago

Hi, I added some changes. Let me know what you think!

Google Analytics

Added piece of code to support Google Analytics. File layouts/partials/head/scripts.html.

Google Search Console

There was an error when indexing a site with Google Search Console. The changes in the file layouts/partials/head/meta.html solve that problem.

Before the changes:

image

After the changes:

image
rawwerks commented 12 months ago

the google search console fix would be particularly useful!

lukeorth commented 12 months ago

Hi @jnonino -- thank you for the contribution!

Do you know if adding the Google Analytics feature will cause it to be enabled for everyone? The Hugo docs state that you must add a tracking ID to the configuration file in order to make it work. However, if a user doesn't provide a tracking number (because they don't want to use Google Analytics) will it still include Google scripts/tracking on their site?

jnonino commented 12 months ago

For what I've seen by not setting the ID in the configuration in dev site, the code I added does not do anything. It only works when you provide a Google Analytics ID

lukeorth commented 12 months ago

Perfect -- that's what I figured, but just wanted to double check. Thanks again for the contribution!