diff --git a/src/renderer/html_handlebars/hbs_renderer.rs b/src/renderer/html_handlebars/hbs_renderer.rs index 4fac6869..1d84c73d 100644 --- a/src/renderer/html_handlebars/hbs_renderer.rs +++ b/src/renderer/html_handlebars/hbs_renderer.rs @@ -193,6 +193,9 @@ fn make_data(book: &MDBook) -> Result data.insert("livereload".to_owned(), json!(livereload)); } + // Add google analytics tag + data.insert("google_analytics".to_owned(), json!("INSERT_GA_ID_HERE")); + let mut chapters = vec![]; for item in book.iter() { diff --git a/src/theme/index.hbs b/src/theme/index.hbs index a99752da..b3985fbc 100644 --- a/src/theme/index.hbs +++ b/src/theme/index.hbs @@ -111,6 +111,19 @@ {{{livereload}}} + {{#if google_analytics}} + + {{/if}} + +