Open
Conversation
81ec48a to
e3be1fb
Compare
jacobgkau
requested changes
Mar 24, 2026
Member
jacobgkau
left a comment
There was a problem hiding this comment.
This causes the book to fail to start:
ERROR Failed to deserialize `output.html`
Caused by: unknown field `google-analytics`, expected one of `theme`, `default-theme`, `preferred-dark-theme`, `smart-punctuation`, `definition-lists`, `admonitions`, `mathjax-support`, `additional-css`, `additional-js`, `fold`, `playground`, `playpen`, `code`, `print`, `no-section-label`, `search`, `git-repository-url`, `git-repository-icon`, `input-404`, `site-url`, `cname`, `edit-url-template`, `live-reload-endpoint`, `redirect`, `hash-files`, `sidebar-header-nav`
That's because the google-analytics option was removed in version 0.5 of mdbook (see also rust-lang/mdBook#1675 & rust-lang/mdBook#2776).
Instead of doing this, we need to add a head.hbs file in the theme directory, and put whatever code snippit you need in there. That file will be put into <head>.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
To get better insight on page views and SEO optimizations, we want to gather some page statistics from google analytics.