mirror of
https://github.com/withastro/astro.git
synced 2025-02-03 22:29:08 -05:00
[ci] format
This commit is contained in:
parent
fad4f64aa1
commit
694fd86739
4 changed files with 7 additions and 7 deletions
|
@ -790,7 +790,7 @@ export interface AstroUserConfig {
|
|||
* Control the output file format of each page. This value may be set by an adapter for you.
|
||||
* - `'file'`: Astro will generate an HTML file named for each page route. (e.g. `src/pages/about.astro` and `src/pages/about/index.astro` both build the file `/about.html`)
|
||||
* - `'directory'`: Astro will generate a directory with a nested `index.html` file for each page. (e.g. `src/pages/about.astro` and `src/pages/about/index.astro` both build the file `/about/index.html`)
|
||||
* - `'preserve'`: Astro will generate HTML files exactly as they appear in your source folder. (e.g. `src/pages/about.astro` builds `/about.html` and `src/pages/about/index.astro` builds the file `/about/index.html`)
|
||||
* - `'preserve'`: Astro will generate HTML files exactly as they appear in your source folder. (e.g. `src/pages/about.astro` builds `/about.html` and `src/pages/about/index.astro` builds the file `/about/index.html`)
|
||||
*
|
||||
* ```js
|
||||
* {
|
||||
|
|
|
@ -44,7 +44,7 @@ export function getOutFolder(
|
|||
let dir;
|
||||
// If the pathname is '' then this is the root index.html
|
||||
// If this is an index route, the folder should be the pathname, not the parent
|
||||
if(pathname === '' || routeData.isIndex) {
|
||||
if (pathname === '' || routeData.isIndex) {
|
||||
dir = pathname;
|
||||
} else {
|
||||
dir = npath.dirname(pathname);
|
||||
|
@ -84,7 +84,7 @@ export function getOutFile(
|
|||
let baseName = npath.basename(pathname);
|
||||
// If there is no base name this is the root route.
|
||||
// If this is an index route, the name should be `index.html`.
|
||||
if(!baseName || routeData.isIndex) {
|
||||
if (!baseName || routeData.isIndex) {
|
||||
baseName = 'index';
|
||||
}
|
||||
return new URL(`./${baseName}.html`, outFolder);
|
||||
|
|
|
@ -15,7 +15,7 @@ describe('build format', () => {
|
|||
});
|
||||
await fixture.build();
|
||||
});
|
||||
|
||||
|
||||
it('outputs', async () => {
|
||||
expect(await fixture.readFile('/client.html')).to.be.ok;
|
||||
expect(await fixture.readFile('/nested-md.html')).to.be.ok;
|
||||
|
@ -36,7 +36,7 @@ describe('build format', () => {
|
|||
});
|
||||
await fixture.build();
|
||||
});
|
||||
|
||||
|
||||
it('outputs', async () => {
|
||||
expect(await fixture.readFile('/client.html')).to.be.ok;
|
||||
expect(await fixture.readFile('/nested-md/index.html')).to.be.ok;
|
||||
|
|
|
@ -67,8 +67,8 @@ describe('build.format', () => {
|
|||
routing: {
|
||||
prefixDefaultLocale: true,
|
||||
redirectToDefaultLocale: true,
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue