-
Notifications
You must be signed in to change notification settings - Fork 18
/
htmlPrivacy.js
45 lines (34 loc) · 1.23 KB
/
htmlPrivacy.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
const fs = require("fs");
const writeFile = (lang, langValues, page, defaultHead, metaTags, defaultNav, nav4, defaultFooter) => {
let writeStream = fs.createWriteStream(lang + "/" + page + ".html");
defaultHead.forEach((heads) => {
writeStream.write(heads);
});
metaTags.forEach((tags) => {
writeStream.write(tags);
});
defaultNav.forEach((navs) => {
writeStream.write(navs);
});
writeStream.write("<h1 class='truncate'>" + langValues.privacy + "</h1>");
nav4.forEach((navs) => {
writeStream.write(navs);
});
writeStream.write("<section class='content-wrapper'>");
writeStream.write("<div class='container'>");
writeStream.write("<h1 class='pt-8 text-upper text-center grayText'>");
writeStream.write(langValues.privacy + "</h1>");
writeStream.write("<div class='py-8'>" + langValues.privacyFull + "</div>");
writeStream.write("</div>");
writeStream.write("</section>");
defaultFooter.forEach((footers) => {
writeStream.write(footers);
});
// 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;