Skip to content

Conversation

@paoloricciuti
Copy link
Member

This allows docs to have their own assets. The pattern is similar to the tutorials: you can have a +assets folder at the root of your docs folder. To reference them in your markdown you can do

![](/docs/[repo]/assets/[nameofthefile])

a couple of things I don't like:

  1. we need to import and pass to create_index a new glob import. This is because we use read in the +server.ts file that needs the actual import and not ?url...we could do read(await import(asset[name])) but that's too complex a dynamic import for vite.
  2. Currently, if you are developing with pnpm docs-sync -w on HMR vite refreshes the import of the image, adding a time query parameter to invalidate the cache. However, read doesn't support query parameters, so it fails...is this a bug in read? The alternative would be to remove the search, but that could lead to cached content (and be a bit of a hack).

Before submitting the PR, please make sure you do the following

  • It's really useful if your PR references an issue where it is discussed ahead of time.
  • Prefix your PR title with feat:, fix:, chore:, or docs:.
  • This message body should clearly illustrate what problems it solves.

@vercel
Copy link

vercel bot commented Oct 8, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Updated (UTC)
svelte-dev Ready Ready Preview Oct 21, 2025 11:35pm

@Ocean-OS Ocean-OS merged commit f431e8e into main Oct 22, 2025
2 checks passed
@Ocean-OS Ocean-OS deleted the docs-assets branch October 22, 2025 17:38
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.

3 participants