File tree 5 files changed +12
-6
lines changed
tool/flutter_site/lib/src/commands
5 files changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -145,7 +145,7 @@ jobs:
145
145
- name : Fetch Dart dependencies
146
146
run : dart pub get
147
147
- name : Build site
148
- run : dart run flutter_site build
148
+ run : dart run flutter_site build --release
149
149
- name : Translated (docs.flutter.cn)
150
150
run : bash tool/translator/build.sh
151
151
shell : bash
Original file line number Diff line number Diff line change 39
39
- name : Fetch Dart dependencies
40
40
run : dart pub get
41
41
- name : Build site
42
- run : dart run flutter_site build
42
+ run : dart run flutter_site build --release
43
43
- name : Translated (docs.flutter.cn)
44
44
run : bash tool/translator/build.sh
45
45
shell : bash
Original file line number Diff line number Diff line change 6
6
google_analytics_id : UA-122680122-1
7
7
# google_site_verification: HFqxhSbf9YA_0rBglNLzDiWnrHiK_w4cqDh2YD2GEY4
8
8
google_tag_manager_id : G-HPSFTRXK91
9
+ baidu_analytics_id : c50919183c6e001b47301f55de682929
9
10
default_share_image : /assets/images/cn/flutter-cn-logo.png
10
11
11
12
Original file line number Diff line number Diff line change 15
15
< link rel ="preconnect " href ="https://fonts.googleapis.cn ">
16
16
< link rel ="preconnect " href ="https://fonts.gstatic.cn " crossorigin >
17
17
{% endunless -%}
18
+
19
+ {%- if isProduction == true -%}
18
20
<!-- Starting the Analysis Code -->
19
21
<!-- Google tag (gtag.js) -->
20
- < script async src ="https://www.googletagmanager.com/gtag/js?id=G-HPSFTRXK91 "> </ script >
22
+ < script async src ="https://www.googletagmanager.com/gtag/js?id={{ site.google_tag_manager_id }} "> </ script >
21
23
< script >
22
24
window . dataLayer = window . dataLayer || [ ] ;
23
25
function gtag ( ) { dataLayer . push ( arguments ) ; }
28
30
var _hmt = _hmt || [ ] ;
29
31
( function ( ) {
30
32
var hm = document . createElement ( "script" ) ;
31
- hm . src = "https://hm.baidu.com/hm.js?c50919183c6e001b47301f55de682929 " ;
33
+ hm . src = "https://hm.baidu.com/hm.js?{{ site.baidu_analytics_id }} " ;
32
34
var s = document . getElementsByTagName ( "script" ) [ 0 ] ;
33
35
s . parentNode . insertBefore ( hm , s ) ;
34
36
} ) ( ) ;
35
37
</ script >
36
38
<!-- Ending the Analysis Code -->
39
+ {% endif -%}
37
40
38
41
{% assign desc = description | default: site.description | strip_html | strip_newlines | truncate: 160 -%}
39
42
{% unless desc and desc != '' or page.url contains '/posts' or page.url contains '/community' -%}
81
84
82
85
<!-- {% render cookie-notice.html %}-->
83
86
84
-
87
+ {%- if isProduction == true -%}
85
88
< noscript >
86
89
< iframe
87
90
src ="https://www.googletagmanager.com/ns.html?id={{ site.google_tag_manager_id }} "
88
91
height ="0 " width ="0 " style ="display:none;visibility:hidden ">
89
92
</ iframe >
90
93
</ noscript >
94
+ {% endif -%}
91
95
92
96
93
97
< div id ="overlay-under-drawer "> </ div >
Original file line number Diff line number Diff line change @@ -37,7 +37,8 @@ final class BuildSiteCommand extends Command<int> {
37
37
const ['eleventy' ],
38
38
environment: {
39
39
'PRODUCTION' : '$productionRelease ' ,
40
- 'OPTIMIZE' : '$productionRelease ' ,
40
+ // docs.flutter.cn 为了翻译工具 (tool/translator) 格式调整和解析,暂不需要优化(压缩 HTML 结构等)
41
+ 'OPTIMIZE' : 'false' , // '$productionRelease'
41
42
},
42
43
);
43
44
You can’t perform that action at this time.
0 commit comments