Skip to content

Commit

Permalink
Better webpage.h
Browse files Browse the repository at this point in the history
  • Loading branch information
ayushsharma82 committed Aug 14, 2020
1 parent a2ff9db commit 2f3fa10
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
7 changes: 6 additions & 1 deletion src/elegantWebpage.h

Large diffs are not rendered by default.

10 changes: 8 additions & 2 deletions ui/compress.js
Original file line number Diff line number Diff line change
Expand Up @@ -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`);
Expand Down

0 comments on commit 2f3fa10

Please sign in to comment.