Skip to content

Conversation

@rickysullivan-gallagher
Copy link

This pull request updates the logic for determining asset paths in the getAssetPath function, making asset path calculation more accurate based on the output directory depth.

When output is set to '/' or '', asset paths are calculated assuming files are 3 levels deep (src/content/docs/notes/file.mdx), but they're actually 2 levels deep (src/content/docs/file.mdx).

This fix dynamically determines the path depth based on the output setting:

  • '' or '/': Use '../..' (2 levels)
  • anything else: Use '../../..' (3 levels, the default)

Fixes issue where images and assets fail to load when using output: '/' with clean root-level URLs.

When output is set to '/' or '', asset paths are calculated assuming files
are 3 levels deep (src/content/docs/notes/file.mdx), but they're actually
2 levels deep (src/content/docs/file.mdx).

This fix dynamically determines the path depth based on the output setting:
- '' or '/': Use '../..' (2 levels)
- anything else: Use '../../..' (3 levels, the default)

Fixes issue where images and assets fail to load when using output: '/'
with clean root-level URLs.
@changeset-bot
Copy link

changeset-bot bot commented Jan 9, 2026

⚠️ No Changeset found

Latest commit: 676ac1b

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel
Copy link

vercel bot commented Jan 9, 2026

Someone is attempting to deploy a commit to the HiDeoo's projects Team on Vercel.

A member of the Team first needs to authorize it.

@HiDeoo
Copy link
Owner

HiDeoo commented Jan 13, 2026

Thanks for the PR 🙌

If I understand correctly, I don't think this use case should be supported by the plugin. As the plugin needs to clean previous builds to ensure that the current build only contains the latest files, using '.' or '' for the output option would effectively mean cleaning the entire content directory, even the ones that are not related to Obsidian.

I think the best approach here would be to error in such cases (as this is not the case right now) and also maybe update the documentation to clarify that the output option should point to a dedicated directory.

@rickysullivan-gallagher
Copy link
Author

I see. For our project a sub folder (/documents) in our vault was our sole Starlight website. We don't want a subfolder structure within Starlight.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants