-
Notifications
You must be signed in to change notification settings - Fork 18
/
htmlManifest.js
168 lines (158 loc) · 7.85 KB
/
htmlManifest.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
const fs = require("fs");
const writeFile = (lang, langValues, page) => {
let writeStream = fs.createWriteStream(lang + "/manifest.json");
writeStream.write("{\n");
writeStream.write(' "short_name": "' + langValues.homeHeader + '",\n');
writeStream.write(' "name": "' + langValues.homeHeader + '",\n');
writeStream.write(' "background_color": "#0078d7",\n');
writeStream.write(' "theme_color": "#0078d7",\n');
writeStream.write(' "display": "standalone",\n');
writeStream.write(' "dir": "' + (lang === "ar" || lang === "fa" || lang === "he" ? "rtl" : "ltr") + '",\n');
writeStream.write(' "lang": "' + lang + '",\n');
writeStream.write(' "iarc_rating_id": "e84b072d-71b3-4d3e-86ae-31a8ce4e53b7",\n');
writeStream.write(' "orientation": "any",\n');
writeStream.write(' "categories": ["education", "books"],\n');
writeStream.write(' "description": "' + langValues.line1 + " " + langValues.line2 + '",\n');
writeStream.write(' "shortcuts": [\n');
writeStream.write(" {\n");
writeStream.write(' "name": "' + langValues.list + '",\n');
writeStream.write(' "short_name": "' + langValues.list + '",\n');
writeStream.write(' "description": "' + langValues.feature4 + '",\n');
writeStream.write(' "url": "/list",\n');
writeStream.write(' "icons": [{ "src": "/images/icons/list.png", "sizes": "192x192" }]\n');
writeStream.write(" },\n");
writeStream.write(" {\n");
writeStream.write(' "name": "' + langValues.compare + '",\n');
writeStream.write(' "short_name": "' + langValues.compare + '",\n');
writeStream.write(' "description": "' + langValues.feature6 + '",\n');
writeStream.write(' "url": "/compare",\n');
writeStream.write(' "icons": [{ "src": "/images/icons/compare.png", "sizes": "192x192" }]\n');
writeStream.write(" },\n");
writeStream.write(" {\n");
writeStream.write(' "name": "' + langValues.printables + '",\n');
writeStream.write(' "short_name": "' + langValues.printables + '",\n');
writeStream.write(' "description": "' + langValues.printables + '",\n');
writeStream.write(' "url": "/printables",\n');
writeStream.write(' "icons": [{ "src": "/images/icons/printables.png", "sizes": "192x192" }]\n');
writeStream.write(" }\n");
writeStream.write(" ],\n");
writeStream.write(' "icons": [\n');
writeStream.write(" {\n");
writeStream.write(' "src": "/images/icons/android-chrome-36x36.png",\n');
writeStream.write(' "sizes": "36x36",\n');
writeStream.write(' "type": "image/png",\n');
writeStream.write(' "purpose": "any"\n');
writeStream.write(" },\n");
writeStream.write(" {\n");
writeStream.write(' "src": "/images/icons/android-chrome-48x48.png",\n');
writeStream.write(' "sizes": "48x48",\n');
writeStream.write(' "type": "image/png",\n');
writeStream.write(' "purpose": "any"\n');
writeStream.write(" },\n");
writeStream.write(" {\n");
writeStream.write(' "src": "/images/icons/android-chrome-72x72.png",\n');
writeStream.write(' "sizes": "72x72",\n');
writeStream.write(' "type": "image/png",\n');
writeStream.write(' "purpose": "any"\n');
writeStream.write(" },\n");
writeStream.write(" {\n");
writeStream.write(' "src": "/images/icons/android-chrome-96x96.png",\n');
writeStream.write(' "sizes": "96x96",\n');
writeStream.write(' "type": "image/png",\n');
writeStream.write(' "purpose": "any"\n');
writeStream.write(" },\n");
writeStream.write(" {\n");
writeStream.write(' "src": "/images/icons/android-chrome-144x144.png",\n');
writeStream.write(' "sizes": "144x144",\n');
writeStream.write(' "type": "image/png",\n');
writeStream.write(' "purpose": "any"\n');
writeStream.write(" },\n");
writeStream.write(" {\n");
writeStream.write(' "src": "/images/icons/apple-touch-icon-152x152.png",\n');
writeStream.write(' "sizes": "152x152",\n');
writeStream.write(' "type": "image/png",\n');
writeStream.write(' "purpose": "any"\n');
writeStream.write(" },\n");
writeStream.write(" {\n");
writeStream.write(' "src": "/images/icons/android-chrome-192x192.png",\n');
writeStream.write(' "sizes": "192x192",\n');
writeStream.write(' "type": "image/png",\n');
writeStream.write(' "purpose": "any"\n');
writeStream.write(" },\n");
writeStream.write(" {\n");
writeStream.write(' "src": "/images/icons/android-chrome-256x256.png",\n');
writeStream.write(' "sizes": "256x256",\n');
writeStream.write(' "type": "image/png",\n');
writeStream.write(' "purpose": "any"\n');
writeStream.write(" },\n");
writeStream.write(" {\n");
writeStream.write(' "src": "/images/icons/android-chrome-384x384.png",\n');
writeStream.write(' "sizes": "384x384",\n');
writeStream.write(' "type": "image/png",\n');
writeStream.write(' "purpose": "any"\n');
writeStream.write(" },\n");
writeStream.write(" {\n");
writeStream.write(' "src": "/images/icons/android-chrome-512x512.png",\n');
writeStream.write(' "sizes": "512x512",\n');
writeStream.write(' "type": "image/png",\n');
writeStream.write(' "purpose": "any"\n');
writeStream.write(" },\n");
writeStream.write(" {\n");
writeStream.write(' "src": "/images/icons/maskable_icon_x512.png",\n');
writeStream.write(' "sizes": "512x512",\n');
writeStream.write(' "type": "image/png",\n');
writeStream.write(' "purpose": "maskable"\n');
writeStream.write(" }\n");
writeStream.write(" ],\n");
writeStream.write(' "screenshots": [\n');
writeStream.write(" {\n");
writeStream.write(' "src": "/screenshots/Phone-1.png",\n');
writeStream.write(' "sizes": "1200x2400",\n');
writeStream.write(' "type": "image/png"\n');
writeStream.write(" },\n");
writeStream.write(" {\n");
writeStream.write(' "src": "/screenshots/Phone-2.png",\n');
writeStream.write(' "sizes": "1200x2400",\n');
writeStream.write(' "type": "image/png"\n');
writeStream.write(" },\n");
writeStream.write(" {\n");
writeStream.write(' "src": "/screenshots/Phone-3.png",\n');
writeStream.write(' "sizes": "1200x2400",\n');
writeStream.write(' "type": "image/png"\n');
writeStream.write(" },\n");
writeStream.write(" {\n");
writeStream.write(' "src": "/screenshots/Phone-4.png",\n');
writeStream.write(' "sizes": "1200x2400",\n');
writeStream.write(' "type": "image/png"\n');
writeStream.write(" },\n");
writeStream.write(" {\n");
writeStream.write(' "src": "/screenshots/Phone-5.png",\n');
writeStream.write(' "sizes": "1200x2400",\n');
writeStream.write(' "type": "image/png"\n');
writeStream.write(" },\n");
writeStream.write(" {\n");
writeStream.write(' "src": "/screenshots/Phone-6.png",\n');
writeStream.write(' "sizes": "1200x2400",\n');
writeStream.write(' "type": "image/png"\n');
writeStream.write(" },\n");
writeStream.write(" {\n");
writeStream.write(' "src": "/screenshots/Phone-7.png",\n');
writeStream.write(' "sizes": "1200x2400",\n');
writeStream.write(' "type": "image/png"\n');
writeStream.write(" },\n");
writeStream.write(" {\n");
writeStream.write(' "src": "/screenshots/Phone-8.png",\n');
writeStream.write(' "sizes": "1200x2400",\n');
writeStream.write(' "type": "image/png"\n');
writeStream.write(" }\n");
writeStream.write(" ],\n");
writeStream.write(' "start_url": "index.html"\n');
writeStream.write("}\n");
// the finish event is emitted when all data has been flushed from the stream
writeStream.on("finish", () => {
console.log("Created " + lang + "-" + page);
});
// close the stream
writeStream.end();
};
exports.writeFile = writeFile;