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

Panini.refresh() does not update partials when only line order is changed. #115

Open
DamianPereira opened this issue May 11, 2017 · 4 comments

Comments

@DamianPereira
Copy link

DamianPereira commented May 11, 2017

Hi, I have a header.html with a dropdown menu, which looks like this:

<header class="nav-bar row align-middle">
  <div class="nav-bar__logo small-3 columns">
    <img src="{{root}}assets/img/logo.png">
  </div>
  <div class="nav-bar__menu columns">
    <ul class="dropdown menu align-right" data-dropdown-menu>
      <li><a class="nav-bar__link" href="{{root}}contacto.html">Contacto</a></li>
      <li><a class="nav-bar__link" href="{{root}}nosotros.html">Nosotros</a></li>
      <li><a class="nav-bar__link" href="{{root}}particulares.html">Particulares</a></li>
      <li><a class="nav-bar__link" href="{{root}}empresas.html">Empresas</a></li>
      <li><a class="nav-bar__link" href="{{root}}index.html">Inicio</a></li>
    </ul>
  </div>
</header>

This file is included in the default layout, with {{> header}}.

If I change the order of the menu items, moving the menu items around, the final page is not updated, but if I change a character it works as expected. The refresh function is called by Gulp, but it does not correctly refresh the changes in the partial.

[BS] Reloading Browsers...
[22:24:28] Finished 'reload' after 895 μs
[22:24:31] Starting 'resetPages'...
[22:24:31] Finished 'resetPages' after 10 ms
[22:24:31] Starting 'pages'...
[22:24:31] Finished 'pages' after 36 ms
[22:24:31] Starting 'reload'...

Also, if I change a page, only that page gets the updated partials, while older pages that did not change still get the old header.

@gakimball
Copy link
Contributor

Is this the ZURB Template you're using?

@DamianPereira
Copy link
Author

DamianPereira commented May 14, 2017

Yes, it's a new project created using the foundation-cli install of the zurb template, only added layouts, pages, and sass files.

@kaluogh
Copy link

kaluogh commented Jul 26, 2019

//gulp 4.0.2 panini 1.6.3
gulp.watch('src/html/pages//*').on('change', gulp.series('compile-html', browserSync.reload));
gulp.watch('src/html/{layouts,includes,helpers,data}/
/*').on('change', gulp.series(async () => { await panini.refresh() }, 'compile-html', browserSync.reload));

@kaluogh
Copy link

kaluogh commented Jul 26, 2019

A pages change ...
B template change
1 panini refresh
2 rebuild html return gulp.src(xxx).pipe(panini(paniniOption)).pipe(gulp.dest(xxxx));
3 browserSync.reload

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

No branches or pull requests

3 participants