From f9c93d23bc5cd50d0063dbeed105c4be9c674eac Mon Sep 17 00:00:00 2001 From: Flaviu Tamas Date: Thu, 25 Dec 2014 20:53:37 -0500 Subject: Mostly get analytics working for docs --- tools/nimweb.nim | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'tools/nimweb.nim') diff --git a/tools/nimweb.nim b/tools/nimweb.nim index 74f561b52..0cf19096d 100644 --- a/tools/nimweb.nim +++ b/tools/nimweb.nim @@ -23,6 +23,7 @@ type gitCommit: string quotations: Table[string, tuple[quote, author: string]] numProcessors: int # Set by parallelBuild:n, only works for values > 0. + gaId: string # google analytics ID, nil means analytics are disabled TRssItem = object year, month, day, title: string TAction = enum @@ -144,7 +145,12 @@ proc parseCmdLine(c: var TConfigData) = c.vars[substr(val, 0, idx-1)] = substr(val, idx+1) of "website": action = actOnlyWebsite of "pdf": action = actPdf - else: quit(usage) + of "googleanalytics": + c.gaId = val + c.nimArgs.add("--doc.googleAnalytics:" & val & " ") + else: + echo("Invalid argument $1" % [key]) + quit(usage) of cmdEnd: break if c.infile.len == 0: quit(usage) -- cgit 1.4.1-2-gfad0