File tree 4 files changed +28
-14
lines changed
4 files changed +28
-14
lines changed Original file line number Diff line number Diff line change @@ -52,12 +52,16 @@ for specification in $specifications; do
52
52
53
53
minorVersion=${version: 0: 3}
54
54
tempfile=" $deploydir /temp/$version .html"
55
+ tempfile2=" $deploydir /temp/$version -2.html"
55
56
56
57
echo === Building $version to $destination
57
58
58
59
node scripts/md2html/md2html.js --maintainers $maintainers $specification " $allVersions " > $tempfile
59
- npx respec --no-sandbox --use-local --src $tempfile --out $destination
60
- rm $tempfile
60
+ npx respec --no-sandbox --use-local --src $tempfile --out $tempfile2
61
+ # remove unwanted Google Tag Manager and Google Analytics scripts
62
+ sed -e ' s/<script type="text\/javascript" async="" src="https:\/\/www.google-analytics.com\/analytics.js"><\/script>//' \
63
+ -e ' s/<script type="text\/javascript" async="" src="https:\/\/www.googletagmanager.com\/gtag\/js?id=G-[^"]*"><\/script>//' \
64
+ $tempfile2 > $destination
61
65
62
66
echo === Built $destination
63
67
@@ -79,6 +83,5 @@ if [ "$latestCopied" != "none" ]; then
79
83
echo Latest tag is $latest , copied $latestCopied to latest.html
80
84
fi
81
85
82
- rm $deploydir /js/respec-w3c.*
83
- rmdir $deploydir /js
84
- rmdir $deploydir /temp
86
+ rm -r $deploydir /js
87
+ rm -r $deploydir /temp
Original file line number Diff line number Diff line change @@ -132,17 +132,18 @@ function preface(title,options) {
132
132
// }
133
133
} ;
134
134
135
- let preface = `<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><title>${ md . utils . escapeHtml ( title ) } </title>` ;
135
+ let preface = '<!DOCTYPE html><html lang="en"><head>\n'
136
+ preface += fs . readFileSync ( path . resolve ( __dirname , './analytics/google.html' ) , 'utf8' ) ;
136
137
137
138
// SEO
138
- preface += '<meta name="description" content="The OpenAPI Specification (OAS) defines a standard, programming language-agnostic interface description for HTTP APIs.">' ;
139
+ preface += `<meta charset="UTF-8">\n<title>${ md . utils . escapeHtml ( title ) } </title>` ;
140
+ preface += '<meta name="description" content="The OpenAPI Specification (OAS) defines a standard, programming language-agnostic interface description for HTTP APIs.">\n' ;
139
141
140
142
// ReSpec
141
143
preface += '<meta name="color-scheme" content="light dark">' ;
142
144
preface += '<script src="../js/respec-w3c.js" class="remove"></script>' ;
143
- preface += `<script class="remove">var respecConfig = ${ JSON . stringify ( respec ) } ;</script>` ;
144
- preface += fs . readFileSync ( path . resolve ( __dirname , './analytics/google.html' ) , 'utf8' ) ;
145
- preface += '</head><body>' ;
145
+ preface += `<script class="remove">var respecConfig = ${ JSON . stringify ( respec ) } ;</script>\n` ;
146
+ preface += '</head>\n<body>' ;
146
147
preface += '<style>' ;
147
148
preface += fs . readFileSync ( path . resolve ( __dirname , 'main.css' ) , 'utf8' ) . split ( / \r ? \n / ) . join ( ' ' ) ;
148
149
preface += fs . readFileSync ( path . resolve ( __dirname , 'gist.css' ) , 'utf8' ) . split ( / \r ? \n / ) . join ( ' ' ) ;
You can’t perform that action at this time.
0 commit comments