scripts
All checks were successful
/ build (push) Successful in 25s

This commit is contained in:
Nycki 2024-12-27 22:22:51 -08:00
parent 4d2401fa90
commit 48c023d582
8 changed files with 53 additions and 5 deletions

9
.gitignore vendored
View file

@ -1,9 +1,8 @@
_site/
_site
node_modules
.cache
patches
tools/in/*
!tools/in/.gitkeep
tools/out/*
!tools/out/.gitkeep
tools/in
tools/out
tina
.env

12
package-lock.json generated
View file

@ -13,6 +13,7 @@
"@11ty/eleventy-plugin-rss": "^2.0.2",
"@11ty/eleventy-plugin-syntaxhighlight": "^5.0.0",
"cross-env": "^7.0.3",
"dotenv": "^16.4.7",
"jsdom": "^25.0.1",
"luxon": "^3.3.0",
"markdown-it-anchor": "^8.6.7",
@ -1389,6 +1390,17 @@
"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": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.0.tgz",

View file

@ -38,6 +38,7 @@
"@11ty/eleventy-plugin-rss": "^2.0.2",
"@11ty/eleventy-plugin-syntaxhighlight": "^5.0.0",
"cross-env": "^7.0.3",
"dotenv": "^16.4.7",
"jsdom": "^25.0.1",
"luxon": "^3.3.0",
"markdown-it-anchor": "^8.6.7",

View file

@ -7,7 +7,18 @@ const dirOut = 'tools/out';
const thresholdBytes = 2 * 1024 * 1024;
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() {
await makedir(dirIn);
await makedir(dirOut);
for (const base of await fs.readdir(dirIn)) {
if (base === '.gitkeep') continue;
const fileIn = `${dirIn}/${base}`;

View file

16
tools/list-files.js Normal file
View 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();

View file

9
tools/secrets.js Normal file
View file

@ -0,0 +1,9 @@
import dotenv from 'dotenv';
dotenv.config();
function main() {
console.log(`SECRET=${process.env.SECRET}`);
}
main();