File tree Expand file tree Collapse file tree 3 files changed +21
-14
lines changed
Expand file tree Collapse file tree 3 files changed +21
-14
lines changed Original file line number Diff line number Diff line change @@ -9,14 +9,15 @@ import (
99
1010// Config is struct of gena's config
1111type Config struct {
12- Title string
13- Description string
14- Template string
15- URL string
16- Logo string
17- Github string
18- Footer string
19- Content * Content
12+ Title string
13+ Description string
14+ Template string
15+ URL string
16+ Logo string
17+ Github string
18+ Footer string
19+ Content * Content
20+ GoogleAnalytics string `yaml:"google_analytics"`
2021}
2122
2223// Content is struct of categories
@@ -48,6 +49,5 @@ func ParseConfig(file string) (*Config, error) {
4849 if err := yaml .Unmarshal (buf , cfg ); err != nil {
4950 return nil , err
5051 }
51-
5252 return cfg , nil
5353}
Original file line number Diff line number Diff line change @@ -17,6 +17,8 @@ footer: © 2017-2020 WebStack design by Viggo
1717# 1. webstack (http://webstack.cc)
1818template : webstack
1919
20+ google_analytics : " G-EXE1PJ8CR2"
21+
2022content :
2123 categories :
2224 - name : 社区
Original file line number Diff line number Diff line change 88 <title>{{ .Title }}</title>
99 <meta name= " keywords" content= " {{ .Description }}" >
1010 <meta name= " description" content= " {{ .Description }}" >
11+ {{ if .GoogleAnalytics }}
12+ <!-- Global site tag (gtag.js ) - Google Analytics -->
13+ <script async src= " https://www.googletagmanager.com/gtag/js?id={{ .GoogleAnalytics }}" ></script>
14+ <script>
15+ window.dataLayer = window.dataLayer || [];
16+ function gtag(){dataLayer.push (arguments);}
17+ gtag('js ', new Date());
18+ gtag('config', '{{ .GoogleAnalytics }}');
19+ </script>
20+ {{ end }}
1121 <link rel= " shortcut icon" href= " https://cdn.jsdelivr.net/gh/x1ah/webstack-assets@master/assets/images/favicon.png" >
1222 <link rel= " stylesheet" href= " http://fonts.googleapis.com/css?family=Arimo:400,700,400italic" >
1323 <link rel= " stylesheet" href= " https://cdn.jsdelivr.net/gh/x1ah/webstack-assets@master/assets/css/fonts/linecons/css/linecons.css" >
1828 <link rel= " stylesheet" href= " https://cdn.jsdelivr.net/gh/x1ah/webstack-assets@master/assets/css/xenon-skins.css" >
1929 <link rel= " stylesheet" href= " https://cdn.jsdelivr.net/gh/x1ah/webstack-assets@master/assets/css/nav.css" >
2030 <script src= " https://cdn.jsdelivr.net/gh/x1ah/webstack-assets@master/assets/js/jquery-1.11.1.min.js" ></script>
21- <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
22- <!--[if lt IE 9]>
23- <script src= " https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js" ></script>
24- <script src= " https://oss.maxcdn.com/respond/1.4.2/respond.min.js" ></script>
25- <![endif]-->
2631 <!-- / FB Open Graph -->
2732 <meta property= " og:type" content= " article" >
2833 <meta property= " og:url" content= " {{ .URL }}" >
You can’t perform that action at this time.
0 commit comments