foundation / panini

A super simple flat file generator.
Other
592 stars 104 forks source link

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

Open DamianPereira opened 7 years ago

DamianPereira commented 7 years ago

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 commented 7 years ago

Is this the ZURB Template you're using?

DamianPereira commented 7 years ago

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

kaluogh commented 4 years ago

//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 commented 4 years ago

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