Updates
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
import type { AstroIntegration } from "astro";
|
||||
import { mkdir, access, constants, copyFile } from 'node:fs/promises'
|
||||
import { mkdir, access, constants, copyFile, rename } from 'node:fs/promises'
|
||||
|
||||
const locales = ["de"];
|
||||
|
||||
@ -20,8 +20,11 @@ export default function configureI18n(): AstroIntegration {
|
||||
await mkdir(cutPrefix(newPath), {recursive: true});
|
||||
}
|
||||
|
||||
await copyFile(`${cutPrefix(oldPath)}index.html`, `${cutPrefix(newPath)}index.${locale}.html`)
|
||||
logger.info(`Copied ${oldPath}index.html to ${newPath}index.${locale}.html`)
|
||||
await copyFile(`${cutPrefix(oldPath)}index.html`, `${cutPrefix(newPath)}index.html.${locale}`)
|
||||
logger.info(`Copied ${oldPath}index.html to ${newPath}index.html.${locale}`)
|
||||
} else {
|
||||
let oldPath = cutPrefix(`${dir.pathname}${page.pathname}`)
|
||||
await rename(`${oldPath}index.html`, `${oldPath}index.html.en`)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user