Skip to content

Follow symlinks inside content/ #3279

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
jamesaorson opened this issue Mar 25, 2025 · 2 comments
Open

Follow symlinks inside content/ #3279

jamesaorson opened this issue Mar 25, 2025 · 2 comments
Labels
enhancement New feature or request

Comments

@jamesaorson
Copy link

jamesaorson commented Mar 25, 2025

Is your feature request related to a problem? Please describe

I want to be able to symlink directories into the content/ dir, or as the content/ dir itself.

When using queryContent in Nuxt v2, or queryCollection in Nuxt v3, symlinks are ignored and I am unable to query for their contents.

Describe the solution you'd like

I would like to be able to do the following

mkdir content
cd content
ln -s ../node_modules/symbolics-data
npm run dev
# See symbolics-data be queryable

Describe alternatives you've considered

I have tried symlinking different levels of the directories, and it seems that it just stops following the moment it hits a symlink.

Additional context

A screenshot of the directory I was trying to use. content was a real directory, containing a symlink to ../node_modules/symbolics-data

We were using a symlink to a directory installed via npm, but if we replace the symlink with the directory itself, nuxt content is super happy and does as we wish.

Image
@jamesaorson jamesaorson added the enhancement New feature or request label Mar 25, 2025
@jamesaorson jamesaorson changed the title Follow symlinks inside content/ Follow symlinks inside content/ Mar 25, 2025
@farnabaz
Copy link
Member

Instead of using symlinks, you can create a collection from an external source. All you need is to define cwd in your collection's source. Checkout https://content.nuxt.com/docs/collections/sources#cwd

@jamesaorson
Copy link
Author

I know I can define this other collection, but why can’t I just use a symlink as well? Is there some kind of design reason Nuxt does not want to follow symlinks?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants