parent
4d2401fa90
commit
48c023d582
8 changed files with 53 additions and 5 deletions
9
.gitignore
vendored
9
.gitignore
vendored
|
@ -1,9 +1,8 @@
|
||||||
_site/
|
_site
|
||||||
node_modules
|
node_modules
|
||||||
.cache
|
.cache
|
||||||
patches
|
patches
|
||||||
tools/in/*
|
tools/in
|
||||||
!tools/in/.gitkeep
|
tools/out
|
||||||
tools/out/*
|
|
||||||
!tools/out/.gitkeep
|
|
||||||
tina
|
tina
|
||||||
|
.env
|
||||||
|
|
12
package-lock.json
generated
12
package-lock.json
generated
|
@ -13,6 +13,7 @@
|
||||||
"@11ty/eleventy-plugin-rss": "^2.0.2",
|
"@11ty/eleventy-plugin-rss": "^2.0.2",
|
||||||
"@11ty/eleventy-plugin-syntaxhighlight": "^5.0.0",
|
"@11ty/eleventy-plugin-syntaxhighlight": "^5.0.0",
|
||||||
"cross-env": "^7.0.3",
|
"cross-env": "^7.0.3",
|
||||||
|
"dotenv": "^16.4.7",
|
||||||
"jsdom": "^25.0.1",
|
"jsdom": "^25.0.1",
|
||||||
"luxon": "^3.3.0",
|
"luxon": "^3.3.0",
|
||||||
"markdown-it-anchor": "^8.6.7",
|
"markdown-it-anchor": "^8.6.7",
|
||||||
|
@ -1389,6 +1390,17 @@
|
||||||
"url": "https://github.com/fb55/domutils?sponsor=1"
|
"url": "https://github.com/fb55/domutils?sponsor=1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/dotenv": {
|
||||||
|
"version": "16.4.7",
|
||||||
|
"resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.4.7.tgz",
|
||||||
|
"integrity": "sha512-47qPchRCykZC03FhkYAhrvwU4xDBFIj1QPqaarj6mdM/hgUzfPHcpkHJOn3mJAufFeeAxAzeGsr5X0M4k6fLZQ==",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=12"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://dotenvx.com"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/dunder-proto": {
|
"node_modules/dunder-proto": {
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.0.tgz",
|
||||||
|
|
|
@ -38,6 +38,7 @@
|
||||||
"@11ty/eleventy-plugin-rss": "^2.0.2",
|
"@11ty/eleventy-plugin-rss": "^2.0.2",
|
||||||
"@11ty/eleventy-plugin-syntaxhighlight": "^5.0.0",
|
"@11ty/eleventy-plugin-syntaxhighlight": "^5.0.0",
|
||||||
"cross-env": "^7.0.3",
|
"cross-env": "^7.0.3",
|
||||||
|
"dotenv": "^16.4.7",
|
||||||
"jsdom": "^25.0.1",
|
"jsdom": "^25.0.1",
|
||||||
"luxon": "^3.3.0",
|
"luxon": "^3.3.0",
|
||||||
"markdown-it-anchor": "^8.6.7",
|
"markdown-it-anchor": "^8.6.7",
|
||||||
|
|
|
@ -7,7 +7,18 @@ const dirOut = 'tools/out';
|
||||||
const thresholdBytes = 2 * 1024 * 1024;
|
const thresholdBytes = 2 * 1024 * 1024;
|
||||||
const quality = [100, 99, 97, 95, 90, 80, 75, 70, 60, 50, 40];
|
const quality = [100, 99, 97, 95, 90, 80, 75, 70, 60, 50, 40];
|
||||||
|
|
||||||
|
async function makedir(dir) {
|
||||||
|
try {
|
||||||
|
await fs.stat(dir);
|
||||||
|
} catch (err) {
|
||||||
|
if (err.code !== 'ENOENT') throw err;
|
||||||
|
await fs.mkdir(dir);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
async function main() {
|
async function main() {
|
||||||
|
await makedir(dirIn);
|
||||||
|
await makedir(dirOut);
|
||||||
for (const base of await fs.readdir(dirIn)) {
|
for (const base of await fs.readdir(dirIn)) {
|
||||||
if (base === '.gitkeep') continue;
|
if (base === '.gitkeep') continue;
|
||||||
const fileIn = `${dirIn}/${base}`;
|
const fileIn = `${dirIn}/${base}`;
|
||||||
|
|
16
tools/list-files.js
Normal file
16
tools/list-files.js
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
import fs from 'node:fs/promises';
|
||||||
|
import path from 'node:path';
|
||||||
|
|
||||||
|
async function main() {
|
||||||
|
let count = 0;
|
||||||
|
for (const file of await fs.readdir('_site', { recursive: true })) {
|
||||||
|
const absolute = path.join('_site', file);
|
||||||
|
const stat = await fs.stat(absolute);
|
||||||
|
if (stat.isDirectory()) continue;
|
||||||
|
console.log(file);
|
||||||
|
count += 1;
|
||||||
|
}
|
||||||
|
console.log(`total: ${count}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
main();
|
9
tools/secrets.js
Normal file
9
tools/secrets.js
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
import dotenv from 'dotenv';
|
||||||
|
|
||||||
|
dotenv.config();
|
||||||
|
|
||||||
|
function main() {
|
||||||
|
console.log(`SECRET=${process.env.SECRET}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
main();
|
Loading…
Reference in a new issue