Merge pull request #1675 from ehuss/deprecate-ga
Deprecate google-analytics
This commit is contained in:
commit
c9b6be8660
|
@ -21,8 +21,8 @@ The following configuration options are available:
|
||||||
- **mathjax-support:** Adds support for [MathJax](../mathjax.md). Defaults to
|
- **mathjax-support:** Adds support for [MathJax](../mathjax.md). Defaults to
|
||||||
`false`.
|
`false`.
|
||||||
- **copy-fonts:** Copies fonts.css and respective font files to the output directory and use them in the default theme. Defaults to `true`.
|
- **copy-fonts:** Copies fonts.css and respective font files to the output directory and use them in the default theme. Defaults to `true`.
|
||||||
- **google-analytics:** If you use Google Analytics, this option lets you enable
|
- **google-analytics:** This field has been deprecated and will be removed in a future release.
|
||||||
it by simply specifying your ID in the configuration file.
|
Use the `theme/head.hbs` file to add the appropriate Google Analytics code instead.
|
||||||
- **additional-css:** If you need to slightly change the appearance of your book
|
- **additional-css:** If you need to slightly change the appearance of your book
|
||||||
without overwriting the whole style, you can specify a set of stylesheets that
|
without overwriting the whole style, you can specify a set of stylesheets that
|
||||||
will be loaded after the default ones where you can surgically change the
|
will be loaded after the default ones where you can surgically change the
|
||||||
|
@ -131,7 +131,6 @@ preferred-dark-theme = "navy"
|
||||||
curly-quotes = true
|
curly-quotes = true
|
||||||
mathjax-support = false
|
mathjax-support = false
|
||||||
copy-fonts = true
|
copy-fonts = true
|
||||||
google-analytics = "UA-123456-7"
|
|
||||||
additional-css = ["custom.css", "custom2.css"]
|
additional-css = ["custom.css", "custom2.css"]
|
||||||
additional-js = ["custom.js"]
|
additional-js = ["custom.js"]
|
||||||
no-section-label = false
|
no-section-label = false
|
||||||
|
|
|
@ -70,6 +70,20 @@ impl MDBook {
|
||||||
|
|
||||||
config.update_from_env();
|
config.update_from_env();
|
||||||
|
|
||||||
|
if config
|
||||||
|
.html_config()
|
||||||
|
.map_or(false, |html| html.google_analytics.is_some())
|
||||||
|
{
|
||||||
|
warn!(
|
||||||
|
"The output.html.google-analytics field has been deprecated; \
|
||||||
|
it will be removed in a future release.\n\
|
||||||
|
Consider placing the appropriate site tag code into the \
|
||||||
|
theme/head.hbs file instead.\n\
|
||||||
|
The tracking code may be found in the Google Analytics Admin page.\n\
|
||||||
|
"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
if log_enabled!(log::Level::Trace) {
|
if log_enabled!(log::Level::Trace) {
|
||||||
for line in format!("Config: {:#?}", config).lines() {
|
for line in format!("Config: {:#?}", config).lines() {
|
||||||
trace!("{}", line);
|
trace!("{}", line);
|
||||||
|
|
Loading…
Reference in New Issue