diff --git a/build.js b/build.js index bd64a420..d3a9828e 100644 --- a/build.js +++ b/build.js @@ -109,4 +109,42 @@ fs.writeFile("./index.html", htmlOutput, function(err) { return console.log(err); } console.log("The file was saved!"); +}); + +// Build Sharing content +var sharingMain = ""; +for (var i = 0; i < source.icons.length; i++) { + var fileName = source.icons[i].title.toLowerCase(); + fileName = fileName.replace(' ', ''); + fileName = fileName.replace('!', ''); + fileName = fileName.replace('.', ''); + fileName = fileName.replace('+', 'plus'); + filePath = "./icons/" + fileName + ".svg"; + console.log(source.icons[i].title + ", sat = " + source.icons[i].saturation); + var fs = require('fs'); + var svg = fs.readFileSync(filePath, 'utf8'); + sharingMain += "\t\t\t
\n"; +} + +// Read sharing header and footer content into variables +var fs = require('fs'); +function readFile(path, callback) { + try { + var filename = require.resolve(path); + fs.readFile(filename, 'utf8', callback); + } catch (e) { + callback(e); + } +} +var fs = require('fs'); +var sharingHeader = fs.readFileSync('./src/sharing-header.html', 'utf8'); +var sharingFooter = fs.readFileSync('./src/sharing-footer.html', 'utf8'); + +// Put all sharing content together and export to sharing.html +var sharingHtmlOutput = sharingHeader + sharingMain + sharingFooter; +fs.writeFile("./sharing.html", sharingHtmlOutput, function(err) { + if(err) { + return console.log(err); + } + console.log("The sharing file was saved!"); }); \ No newline at end of file diff --git a/og.png b/og.png new file mode 100644 index 00000000..e1698a1b Binary files /dev/null and b/og.png differ diff --git a/sharing.html b/sharing.html new file mode 100644 index 00000000..51b5d27f --- /dev/null +++ b/sharing.html @@ -0,0 +1,169 @@ + + + + + +