OleVik / grav-plugin-static-generator

Indexing and static generation of Page(s) for Grav.
MIT License
22 stars 1 forks source link

`pages` undefined in twig templates when generating static site #18

Open voodoos opened 3 years ago

voodoos commented 3 years ago

I have a weird issue with my Grav project. I would like to use grav-plugin-static-generator to generate a static version of my site. I use the following command:

bin/plugin static-generator page "/" -a -s -i

Then if I have a page whose templates does {{ print_r(pages) }}. If I reach that page in the live website the root page object is printed as expected.

However in the generated page nothing at all is printed, as if the variable was undefined. This messes the menu generation.

Am I doing something wrong ?

voodoos commented 3 years ago

Were you able to reproduce the issue ? If you don't I can try to provide one.

Is there a version of Grav, or that plugin that I can downgrade to to build my website ?

OleVik commented 3 years ago

I've not had time to work on reproducing it, if you could reliably do so a zipped copy of Grav would help a lot. It should be compatible with all of 1.6-1.7, though I'm not sure how well it would work with print_r. Is that ran as a function through a Twig-extension?

sdegrande commented 2 months ago

I'm new to Grav. I have the same issue. I just installed Grav (v 1.7.46). It creates 2 pages, with the Quark theme. The navigation menu uses 'pages' to create a link per page. It works fine in live, but the menu is empty with the SSG plugin...