Browse Source

Better webpage.h

Ayush Sharma 4 years ago
parent
commit
2f3fa10358
2 changed files with 11 additions and 2 deletions
  1. 3 0
      src/elegantWebpage.h
  2. 8 2
      ui/compress.js

File diff suppressed because it is too large
+ 3 - 0
src/elegantWebpage.h


+ 8 - 2
ui/compress.js

@@ -31,8 +31,14 @@ gzip(HTML, { numiterations: 15 }, (err, output) => {
     return console.error(err);
   }
 
-  const FILE = `const uint32_t ELEGANT_HTML_SIZE = ${output.length};
-const uint8_t ELEGANT_HTML[] PROGMEM = { ${output} };`;
+  const FILE = `#ifndef ElegantOTAWebpage_h
+#define ElegantOTAWebpage_h
+
+const uint32_t ELEGANT_HTML_SIZE = ${output.length};
+const uint8_t ELEGANT_HTML[] PROGMEM = { ${output} };
+
+#endif
+`;
 
   FS.writeFileSync(path.resolve(__dirname, '../src/elegantWebpage.h'), FILE);
   console.log(`[COMPRESS] Compressed Build Files to elegantWebpage.h: ${output.length} Bytes`);

Some files were not shown because too many files changed in this diff