-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
introduce `collectionPathMode` to handle sites where content collections are in the root of the site --------- Co-authored-by: Alex Vernacchia <[email protected]>
- Loading branch information
1 parent
3ce0276
commit fc33147
Showing
4 changed files
with
160 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,28 @@ | ||
export type CollectionPathMode = 'subdirectory' | `root` | ||
|
||
export interface Options { | ||
contentPath?: string; // where you store your content relative to the root directory | ||
/** | ||
* @name collectionPathMode | ||
* @type {CollectionPathMode} | ||
* @default `'subdirectory'` | ||
* @description | ||
* | ||
* Where you store your collections: | ||
* - `'subdirectory'` - Subdirectories under `contentPath` (ex: `src/content/docs/index.md` where `docs` is the content collection subdirectory of the contentPath `src/content`) | ||
* - `'root'` - Directly inside `contentPath` (ex: `src/content/docs/index.md` where `src/content/docs` is the `contentPath`) | ||
* | ||
* Use the `root` configuration option when you are explicitly setting the {@link contentPath} property to something other than `src/content` and you want the directory you specify | ||
* for {@link contentPath} to be treated a single content collection as if it where located in the site root. In most scenarios, you should set this value to `subdirectory` or not | ||
* set this value and the default of `subdirectory` will be used. | ||
* @example | ||
* ```js | ||
* { | ||
* // Use `subdirectory` mode | ||
* collectionPathMode: `subdirectory` | ||
* } | ||
* ``` | ||
*/ | ||
collectionPathMode?: CollectionPathMode; | ||
basePath?: string; // https://docs.astro.build/en/reference/configuration-reference/#base | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters