You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The .refresh() stuff isn't in there right now. Eventually all that stuff is going to be automatic, so you won't have to call it at all, but it's taking some time to implement properly.
In the mean time, you can access the underlying Panini instance and call the refresh() method directly, although it's a little janky. Can you let me know if integrating this code into your build process works? Thanks :)
Make sure pages:refresh doesn't run on the initial build—it doesn't need to anyway, because the library loads all the layouts, partials, etc. automatically on the first run.
Yeah, refresh page is hard. @gakimball i try to use watch(), but no success, they can't find this.panini.options.pages and throw error.
I hardcode 'pages' for this.panini.options.pages, and watch() start working properly, but only inside pages directory.
Callback for watch() will be awesome, for reloading page.
I've been working on file watching over the past week and I've made decent progress. I abstracted some of the more complex dependency management stuff into a small module: https://github.com/gakimball/bistro
But this is only a workaround, because it creates a new Panini instance in every tasks. In my watch tasks i watch for the files and if they change i call the pages tasks again. Partials and layouts will get Updated, but locales still won't be updated.
I've also tried to use p.watch() to avoid watching the changed files by myself and get rid of a new instance of the pages task, but this gives the following error.
[22:52:18] TypeError: Path must be a string. Received undefined
at assertPath (path.js:28:11)
at Object.join (path.js:1236:7)
at module.exports.watch (/Users/marvinhuebner/Projekte/ait/staging-pages/node_modules/panini/index.js:57:27)
at /Users/marvinhuebner/Projekte/ait/staging-pages/gulpfile.babel.js:123:6
at /Users/marvinhuebner/Projekte/ait/staging-pages/gulpfile.babel.js:68:3
at Array.map (<anonymous>)
at pageFolders (/Users/marvinhuebner/Projekte/ait/staging-pages/gulpfile.babel.js:67:15)
at /Users/marvinhuebner/Projekte/ait/staging-pages/gulpfile.babel.js:115:3
at new Promise (<anonymous>)
at pages (/Users/marvinhuebner/Projekte/ait/staging-pages/gulpfile.babel.js:114:9)
Activity
gakimball commentedon Oct 11, 2017
The
.refresh()stuff isn't in there right now. Eventually all that stuff is going to be automatic, so you won't have to call it at all, but it's taking some time to implement properly.In the mean time, you can access the underlying Panini instance and call the
refresh()method directly, although it's a little janky. Can you let me know if integrating this code into your build process works? Thanks :)Make sure
pages:refreshdoesn't run on the initial build—it doesn't need to anyway, because the library loads all the layouts, partials, etc. automatically on the first run.XAMelleOH commentedon Oct 12, 2017
@gakimball
Unfortunately, it gives me
TypeError: Cannot read property 'refresh' of undefinedBut I changed it to this and it works (not correct but at least works):
So, it's fine with partials now, but still not updating translations :(
XAMelleOH commentedon Oct 12, 2017
Ok, I've tested it all again: translations data is never updated.
The only way to get partials updated with watch is using
.create, which you've recommended here: #45 (comment)gakimball commentedon Oct 12, 2017
In the task where you run
paniniInstance.refresh(), are you returning that function? That's necessary because it's an asynchronous function now.XAMelleOH commentedon Oct 12, 2017
Yes, I'm.
gakimball commentedon Oct 12, 2017
Alright, thanks for your patience in working through this with me :) I should be able to look into this in the next few days.
illycz commentedon Dec 2, 2017
Any progress?
Translations data is never updated...
benland commentedon Jan 16, 2018
If someone found a solution it would be very helpful. @XAMelleOH @illycz .
@gakimball thanks for all your work!
kuzvac commentedon Feb 13, 2018
Yeah, refresh page is hard. @gakimball i try to use watch(), but no success, they can't find this.panini.options.pages and throw error.
I hardcode 'pages' for this.panini.options.pages, and watch() start working properly, but only inside pages directory.
Callback for watch() will be awesome, for reloading page.
gakimball commentedon Feb 13, 2018
I've been working on file watching over the past week and I've made decent progress. I abstracted some of the more complex dependency management stuff into a small module: https://github.com/gakimball/bistro
Hoping to have something for people to use soon!
marvinhuebner commentedon Apr 18, 2018
None of the given solutions (#143 (comment) or #45 (comment)) has worked for me.
For now i use panini programmatically inside gulp with a promise:
But this is only a workaround, because it creates a new Panini instance in every tasks. In my watch tasks i watch for the files and if they change i call the
pagestasks again. Partials and layouts will get Updated, but locales still won't be updated.I've also tried to use
p.watch()to avoid watching the changed files by myself and get rid of a new instance of thepagestask, but this gives the following error.@gakimball i've installed the current https://github.com/zurb/panini/tree/v2.0 branch, maybe this info is useful for you.