-
-
Notifications
You must be signed in to change notification settings - Fork 359
fix(analytics): Matomo analytics #817
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
✅ Deploy Preview for hugo-hextra ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
| https://developer.matomo.org/guides/tracking-javascript-guide | ||
| */ -}} | ||
|
|
||
| {{- with .Site.Params.analytics.matomo -}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is also checked at
| {{- if .Site.Params.analytics.matomo -}} |
I guess we don't need both?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's 2 different things:
- The
ifis purely conditional and doesn't change the scope of. - The
withis conditional, but it also changes the scope of.
IMHO, it's better to have a larger scope at the global partial level (because it's easier to override), and inside the partial have a restricted scope for readability and maintenance.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤔 If someone wants to override (to a specific analytics), he can either override layouts/_partials/components/analytics/analytics.html or add an element inside layouts/_partials/custom/head-end.html.
So I think I will use with.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's 2 different things:
- The
ifis purely conditional and doesn't change the scope of.- The
withis conditional, but it also changes the scope of.IMHO, it's better to have a larger scope at the global partial level (because it's easier to override), and inside the partial have a restricted scope for readability and maintenance.
I see, that makes more sense, I think I’d actually prefer giving the partial a broader scope now 🤔
This reverts commit 1d86e6f.
I forgot the
withand to fill the TODO.