From 34114b5f77e119b32a61279cfd8ad00725802ea3 Mon Sep 17 00:00:00 2001 From: Dan Leech Date: Mon, 19 Oct 2015 11:08:22 +0100 Subject: [PATCH] Added sharing image generator --- build.js | 38 +++++++++ og.png | Bin 0 -> 8995 bytes sharing.html | 169 ++++++++++++++++++++++++++++++++++++++++ src/sharing-footer.html | 5 ++ src/sharing-header.html | 60 ++++++++++++++ 5 files changed, 272 insertions(+) create mode 100644 og.png create mode 100644 sharing.html create mode 100644 src/sharing-footer.html create mode 100644 src/sharing-header.html 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 0000000000000000000000000000000000000000..e1698a1b91ede13425897b40b47ec895db1fb676 GIT binary patch literal 8995 zcmeHLXH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;x?_4yn-sz<`hZ&F~}X40G3fyVueb7hb6#n388k4cS@*yR<7 z<3YxZ7zaD4?#QRLT3V3qfm`K1Jw3L zm%|Pf_rWtpqlEX%j>BY4VmN8Uu|S(Ra_@j+p=(1YgYe8W?A$-tX9(D*%1v23OcjnN zAlwB0iw_Lhh6fA;4UfG-SW<)ay}#iOmW4{_1!T8=&BqD<7Ud8@7rmZ#3O3>xZ8QUSA6)D57;Y(-+tq zl6?5%&n%{yed^R2x6C$J#$QVLMepeiud0_7b+)UXmNCtx&e%QsP%%m`)F&vX{-l1b zMxMnHlZ^XIy#7^6yh0yak`>{05sC72N-mLi2Mbsat_;ujX3pd#9JEi7;SY@E(ab#C zh=fhaf@CCW9#PcEa7<{Ak%D{`uK6H7%aLykx^jyc zNq8-NZQ1q*j~j>FU_ETyfL?hhR`*zIzutLs+h;NWlN$Y*&sX+z^x%7e + + + + + Simple Icons Open Graph Image + + + + + + + + \ No newline at end of file diff --git a/src/sharing-footer.html b/src/sharing-footer.html new file mode 100644 index 00000000..a1ba3596 --- /dev/null +++ b/src/sharing-footer.html @@ -0,0 +1,5 @@ + +

    Simple Icons

    + + + \ No newline at end of file diff --git a/src/sharing-header.html b/src/sharing-header.html new file mode 100644 index 00000000..ff4fecfc --- /dev/null +++ b/src/sharing-header.html @@ -0,0 +1,60 @@ + + + + + + Simple Icons Open Graph Image + + + + + +