Fixing and Sitemap and Robots.txt
This commit is contained in:
@ -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})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user