Fix day offset by one
This commit is contained in:
parent
dc4efbea58
commit
5a0364976a
3 changed files with 49 additions and 17 deletions
21
scripts/fix-paths.mjs
Normal file
21
scripts/fix-paths.mjs
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
import { readFileSync, writeFileSync, readdirSync } from 'fs';
|
||||
import { join } from 'path';
|
||||
|
||||
const dist = join(import.meta.dirname, '..', 'dist');
|
||||
|
||||
function fixFile(filePath) {
|
||||
let content = readFileSync(filePath, 'utf-8');
|
||||
// Replace /_astro/ with ./_astro/
|
||||
content = content.replace(/\/_astro\//g, './_astro/');
|
||||
// Replace /favicon with ./favicon
|
||||
content = content.replace(/href="\/favicon/g, 'href="./favicon');
|
||||
writeFileSync(filePath, content, 'utf-8');
|
||||
}
|
||||
|
||||
for (const file of readdirSync(dist)) {
|
||||
if (file.endsWith('.html')) {
|
||||
fixFile(join(dist, file));
|
||||
}
|
||||
}
|
||||
|
||||
console.log('Fixed relative paths in dist/');
|
||||
Loading…
Add table
Add a link
Reference in a new issue