Skip to content
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

Google Analytics Workaround Until pydata_sphinx_theme Fix Released #123

Merged
merged 1 commit into from
Aug 31, 2021

Conversation

erogluorhan
Copy link
Member

@erogluorhan erogluorhan commented Aug 30, 2021

Closes #105

This PR is intended for using a workaround to get Foundations Book's Google Analytics working until this pydata-sphinx-theme PR gets merged and released.

Brief Explanation of Solution:

  • google_analytics_id under html tag in _config.yml is disabled. Instead, templates_path under sphinx tag as a config item into this file.
  • In _templates/layout.html, we still extend sphinx_book_theme/layout.html that is the default jupyter-book that we are already using here.
  • In that layout file, we are manually adding the Google Analytics snippet as suggested by Google to the extrahead before body.
  • The other html files in the _templates folder are just for avoiding build errors.

The source of the locally generated book seems to be correct as follows:
image

There was a slight difference in the footer of the newly generated book compared to the published one in my local as follows; however, there is no such difference in the generated preview here, so I think we don't need to worry about that?
image

@erogluorhan erogluorhan requested a review from a team August 30, 2021 19:39
@erogluorhan erogluorhan requested a review from a team as a code owner August 30, 2021 19:39
@erogluorhan erogluorhan requested review from dopplershift, jukent, ktyle and brian-rose and removed request for a team August 30, 2021 19:39
@github-actions
Copy link

🚀 📚 Preview for git commit SHA: 421bf74 at: https://612d35f8d9efcc29d87c61e8--pythia-foundations.netlify.app

@erogluorhan
Copy link
Member Author

Hi @kmpaul , just FYI: I added the Infrastructure group as the reviewer, thinking it may add you, but it didn't add you.

@erogluorhan erogluorhan requested review from kmpaul and removed request for dopplershift, jukent, ktyle and brian-rose August 30, 2021 19:51
Copy link
Contributor

@kmpaul kmpaul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, @erogluorhan! Thanks for doing this!

@kmpaul
Copy link
Contributor

kmpaul commented Aug 31, 2021

Merge when ready.

@erogluorhan erogluorhan merged commit 000661f into main Aug 31, 2021
@erogluorhan erogluorhan deleted the analytics branch August 31, 2021 17:25
@erogluorhan erogluorhan changed the title Google Analytics Workaround Until Pydata Fix Gets Released Google Analytics Workaround Until pydata_sphinx_theme Fix Released Sep 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Google Analytics not working
2 participants