Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions build.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
const fs = require('fs');
const page_structure = fs.readFileSync('page-structure.html', {encoding:'utf8'});
const src_compressed = fs.readFileSync('src-compressed-string.base64', {encoding:'utf8'}).trim()
const page01 = page_structure.replace('SRC_COMPRESSED_STRING', src_compressed);
console.log(page01);
4 changes: 3 additions & 1 deletion package.opm.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{
"MatterJS": "9d567e6ef8bd6b13458cc67cc5e8339395a4433e45db4554ff83c88a5df8bae2i0",
"jQuery": "773e4865bcf3084e6d6ee5d49136fb5f7071d4c050ec4aeeaeb9c6d24fea5fc1i0"
"jQuery": "773e4865bcf3084e6d6ee5d49136fb5f7071d4c050ec4aeeaeb9c6d24fea5fc1i0",
"Compress": "2dbdf9ebbec6be793fd16ae9b797c7cf968ab2427166aaf390b90b71778266abi0",
"p5js": "255ce0c5a0d8aca39510da72e604ef8837519028827ba7b7f723b7489f3ec3a4i0"
}
5 changes: 5 additions & 0 deletions templates/compress-html/.minify.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"js": {
"removeUnusedVariables": false
}
}
10 changes: 10 additions & 0 deletions templates/compress-html/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
all: src-compressed-string.base64 index.html

index.html: src-compressed-string.base64 build.js page-structure.html
bun build.js >$@

src-compressed-string.base64: input/
cat input/* | gzip -9 -c | base64 | tr -d '\n' >$@

clean:
rm -f src-compressed-string.base64 index.html
7 changes: 7 additions & 0 deletions templates/compress-html/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
### Compress HTML

1. Navigate to the `compress-html` directory with `cd compress-html`.
2. Place your `.html` file in the `input` directory.
3. Run `make clean && make` in the terminal.
4. Your compressed file will be `index.html`.
5. To check if `index.html` file works locally, open `index.html` and search and replace "fetch(/content/" with "fetch(https://ordinals.com/content/".
5 changes: 5 additions & 0 deletions templates/compress-html/build.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
const fs = require('fs');
const page_structure = fs.readFileSync('page-structure.html', {encoding:'utf8'});
const src_compressed = fs.readFileSync('src-compressed-string.base64', {encoding:'utf8'}).trim()
const page01 = page_structure.replace('SRC_COMPRESSED_STRING', src_compressed);
console.log(page01);

Large diffs are not rendered by default.

Loading