Open sensaetions opened 6 years ago
Where are you writing {{> file-name}}
? Usually you'd get a Handlebars error if it can't find the partial.
I’m importing the handlebars partials into default.html
layout and pages, but not getting any errors either.
@gakimball, Can you or someone provide a simple project, with a sample gulp file and file structure so that I can see how a project is set up to use panini and get it working? Thank you in advance.
Assuming you're using v1 of Panini, the ZURB Template has got your back: https://github.com/zurb/foundation-zurb-template
@gakimball Thanks for suggesting the Foundation Zurb template as a sample. I have used the Foundation Zurb template, but I would prefer something much leaner with just the Panini parts, and without the Foundation framework. Do you have any lean samples?
How many versions of Panini are there, if you're asking if I'm using v1?
Looking at your code sample closer, I've realized there's something critical you've missed.
There's a function called panini.refresh()
that loads all the templates, partials, helpers, data, etc. into the system before the pages are compiled. This exists so that those things don't happen every time the main Gulp task is re-run.
However, it's an annoying API because it's not super obvious. In a future version of Panini I'm getting rid of it and making that process automatic.
If you look at the Gulpfile for the ZURB template, there's a task here that calls panini.refresh()
.
There's also a gulp.watch
call to reference this task here.
Add this into your Gulpfile and let me know if that fixes things. :)
How many versions of Panini are there, if you're asking if I'm using v1?
v1 is the only stable one. I've been making a v2 in my spare time over the last year. It's nearly there, but I don't have a lot of time to work on it these days. I'd recommend sticking with v1 for now. Migrating to v2 will be pretty straightforward, since all the core concepts of Panini are the same.
@gakimball Thank you for the code samples; I'll take a look and see if I can adapt it into my gulpfile. I'll let you know what the results are.
Looking at your code sample closer, I've realized there's something critical you've missed.
There's a function called
panini.refresh()
that loads all the templates, partials, helpers, data, etc. into the system before the pages are compiled. This exists so that those things don't happen every time the main Gulp task is re-run.However, it's an annoying API because it's not super obvious. In a future version of Panini I'm getting rid of it and making that process automatic.
If you look at the Gulpfile for the ZURB template, there's a task here that calls
panini.refresh()
.There's also a
gulp.watch
call to reference this task here.Add this into your Gulpfile and let me know if that fixes things. :)
How many versions of Panini are there, if you're asking if I'm using v1?
v1 is the only stable one. I've been making a v2 in my spare time over the last year. It's nearly there, but I don't have a lot of time to work on it these days. I'd recommend sticking with v1 for now. Migrating to v2 will be pretty straightforward, since all the core concepts of Panini are the same.
Thanks, i follow gulpfile.babel. Works for me..
Hello, I'm interested in using the standalone panini in my project. However, I'm struggling to get it to work and recognize my partials. I've set up my Panini gulp task as so:
But when I go to include my partials
{{> file-name}}
, panini only outputs that exactly (not the contents of that file). Can anyone help clarify where I went wrong and how to fix it?