Fixing and Sitemap and Robots.txt

This commit is contained in:
2023-12-10 17:14:10 +01:00
parent 3d95bffb6a
commit 6c9c496f05
33 changed files with 150 additions and 57 deletions

View File

@ -1,6 +1,5 @@
import type { AstroIntegration } from "astro";
import { mkdir, rename, access, constants } from 'node:fs/promises'
import {rm} from "fs/promises";
import { mkdir, access, constants, copyFile } from 'node:fs/promises'
const locales = ["de"];
@ -21,14 +20,10 @@ export default function configureI18n(): AstroIntegration {
await mkdir(cutPrefix(newPath), {recursive: true});
}
await rename(`${cutPrefix(oldPath)}index.html`, `${cutPrefix(newPath)}index.${locale}.html`)
logger.info(`Renamed ${oldPath} to ${newPath}`)
await copyFile(`${cutPrefix(oldPath)}index.html`, `${cutPrefix(newPath)}index.${locale}.html`)
logger.info(`Copied ${oldPath}index.html to ${newPath}index.${locale}.html`)
}
}
for (let locale of locales) {
await rm(`${cutPrefix(dir.pathname)}${locale}`, {recursive: true, force: true})
}
}
}
}