File tree Expand file tree Collapse file tree 2 files changed +16
-3
lines changed
guide/src/format/configuration Expand file tree Collapse file tree 2 files changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -21,8 +21,8 @@ The following configuration options are available:
2121- ** mathjax-support:** Adds support for [ MathJax] ( ../mathjax.md ) . Defaults to
2222 ` false ` .
2323- ** copy-fonts:** Copies fonts.css and respective font files to the output directory and use them in the default theme. Defaults to ` true ` .
24- - ** google-analytics:** If you use Google Analytics, this option lets you enable
25- it by simply specifying your ID in the configuration file .
24+ - ** google-analytics:** This field has been deprecated and will be removed in a future release.
25+ Use the ` theme/head.hbs ` file to add the appropriate Google Analytics code instead .
2626- ** additional-css:** If you need to slightly change the appearance of your book
2727 without overwriting the whole style, you can specify a set of stylesheets that
2828 will be loaded after the default ones where you can surgically change the
@@ -131,7 +131,6 @@ preferred-dark-theme = "navy"
131131curly-quotes = true
132132mathjax-support = false
133133copy-fonts = true
134- google-analytics = " UA-123456-7"
135134additional-css = [" custom.css" , " custom2.css" ]
136135additional-js = [" custom.js" ]
137136no-section-label = false
Original file line number Diff line number Diff line change @@ -70,6 +70,20 @@ impl MDBook {
7070
7171 config. update_from_env ( ) ;
7272
73+ if config
74+ . html_config ( )
75+ . map_or ( false , |html| html. google_analytics . is_some ( ) )
76+ {
77+ warn ! (
78+ "The output.html.google-analytics field has been deprecated; \
79+ it will be removed in a future release.\n \
80+ Consider placing the appropriate site tag code into the \
81+ theme/head.hbs file instead.\n \
82+ The tracking code may be found in the Google Analytics Admin page.\n \
83+ "
84+ ) ;
85+ }
86+
7387 if log_enabled ! ( log:: Level :: Trace ) {
7488 for line in format ! ( "Config: {:#?}" , config) . lines ( ) {
7589 trace ! ( "{}" , line) ;
You can’t perform that action at this time.
0 commit comments