Skip to content

Commit

Permalink
Merge pull request go-gitea#97 from richmahn/feature/fixes-80-add-goo…
Browse files Browse the repository at this point in the history
…gle-analytics-to-templates

Fixes go-gitea#80: add Google Analytics to templates
  • Loading branch information
richmahn authored Nov 23, 2016
2 parents 1fa996b + 2787276 commit e518cca
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions modules/setting/setting.go
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,9 @@ var (
RunUser string
IsWindows bool
HasRobotsTxt bool
Google struct {
GATrackingID string
}
)

// DateLang transforms standard language locale name to corresponding value in datetime plugin.
Expand Down Expand Up @@ -592,6 +595,7 @@ please consider changing to GITEA_CUSTOM`)
ShowFooterBranding = Cfg.Section("other").Key("SHOW_FOOTER_BRANDING").MustBool()
ShowFooterVersion = Cfg.Section("other").Key("SHOW_FOOTER_VERSION").MustBool()
ShowFooterTemplateLoadTime = Cfg.Section("other").Key("SHOW_FOOTER_TEMPLATE_LOAD_TIME").MustBool()
Google.GATrackingID = Cfg.Section("other").Key("GA_TRACKING_ID").String()

HasRobotsTxt = com.IsFile(path.Join(CustomPath, "robots.txt"))
}
Expand Down
3 changes: 3 additions & 0 deletions modules/template/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,9 @@ func NewFuncMap() []template.FuncMap {
}
return "tab-size-8"
},
"GATrackingID": func() string {
return setting.Google.GATrackingID
},
}}
}

Expand Down

0 comments on commit e518cca

Please sign in to comment.