Skip to content

Commit

Permalink
Allow file URL for base dir
Browse files Browse the repository at this point in the history
  • Loading branch information
ascorbic committed Jul 8, 2024
1 parent 391e7e6 commit 7bc79e9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions packages/astro/src/content/loaders/glob.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ export interface GenerateIdOptions {
export interface GlobOptions {
/** The glob pattern to match files, relative to the base directory */
pattern: string;
/** The base directory to resolve the glob pattern from, relative to the root directory. Defaults to `.` */
base?: string;
/** The base directory to resolve the glob pattern from. Relative to the root directory, or an absolute file URL. Defaults to `.` */
base?: string | URL;
/**
* Function that generates an ID for an entry. Default implementation generates a slug from the entry path.
* @returns The ID of the entry. Must be unique per collection.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ const cats = defineCollection({


// Absolute paths should also work
const absoluteRoot = new URL('../../content-outside-src', import.meta.url).href;
const absoluteRoot = new URL('../../content-outside-src', import.meta.url);

const spacecraft = defineCollection({
type: 'experimental_data',
Expand Down

0 comments on commit 7bc79e9

Please sign in to comment.