Skip to content
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

Partials do not update when content is in a symlink #1690

Closed
adamfortuna opened this issue Nov 19, 2015 · 3 comments

Comments

@adamfortuna
Copy link

@adamfortuna adamfortuna commented Nov 19, 2015

If you render a partial, and that partial exists in a symlink, it will work and render correctly. However, if you edit the content of that partial and reload the page, it will not use the updated partial. I have a feeling it has to do with having some internal cache based on the files modified date, and its not picking up changes within a symlink.

I've tried adding the symlinked folder to reload paths (both relative, and the original folder) but looks like it's not reloading in those cases. Here's the steps to reproduce:

If you have a folder outside of your middleman project called "/users/me/code/my_folder" and symlink that into your Middleman "source/symlinked_in_folder" folder and try to use a partial within that folder you'll see this behavior.

= partial 'symlinked_in_folder/example'

Just ran into this, and am still tracking it down. If I do, I'll try adding a PR with it. :)

@adamfortuna adamfortuna changed the title Using partial doesn Partials do not update when content is in a symlink Nov 19, 2015
@adamfortuna

This comment has been minimized.

Copy link
Author

@adamfortuna adamfortuna commented Nov 20, 2015

Narrowed this down to v3.4 Listen.to not working as you'd expect ( issue here in the listen gem ) guard/listen#279 .

https://github.com/middleman/middleman/blob/v3.4.0/middleman-core/lib/middleman-core/preview_server.rb#L174

A workaround for the moment is to use the force_polling option, which does cause these to update:

middleman server --reload-paths data/,lib/ --force_polling true

Going to also try updating to 4's rc to see if that helps out as a next step.

@jimothyGator

This comment has been minimized.

Copy link
Contributor

@jimothyGator jimothyGator commented Feb 4, 2016

I've found that Middleman 4's multiple source folders has eliminated my need for symlinks. There's not a lot of documentation for it at present, but you can find some examples in the test fixtures, such as multiple-sources-app and multiple-sources-with-duplicate-file-names-app. Check out config.rb in both directories.

Also possibly useful, though I haven't yet used this myself, are the import_path and import_file methods. Example

@sandstrom

This comment has been minimized.

Copy link
Contributor

@sandstrom sandstrom commented Nov 20, 2016

I'm doing some issue-gardening 🌿🌷🌾 and came across this issue.

Sorry that this has lingered for quite a while! This should work in v4. If not a a PR with a failing test would be a great start.

Also, @jimothyGator if you'd like to provide a PR to the docs (https://github.com/middleman/middleman-guides) that would be awesome! ⛵️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.