d4l-data4life / kirby3-static-site-generator

Static site generator plugin for Kirby 3+. With this plugin you can create a directory with assets, media and static html files generated from your pages. The result is an even faster site with less potential vulnerabilities.
MIT License
134 stars 8 forks source link

Default Language by getting text of children pages #83

Closed Sunnyka98 closed 9 months ago

Sunnyka98 commented 11 months ago

I make a overview page for the next 2 generations of pages.

Expected Behavior

On the localhost the page render as expect in the current language.

I expect that the site is identical render after using the static site generater.

Current Behavior

The static site using the default language (german) instead of the current language (english) for the texts of the children pages.

Steps to Reproduce

I get a plain kit from kirby. Add some pages and the static site generator. I made a little repo to show the error. If you run the generator.php, an look than in the build folder to the index.html the title and text of the childeren, grand-children and grand-grand-children is in the default language.

Context

I use the kirby version 3.9.6, version 1.12.1 from the static-site-generater on Windows and the plugin is manually installed as submodule. I trigger the static site generator manually via script.

jonathan-reisdorf commented 10 months ago

Hi @Sunnyka98,

sorry for the late response, thank you for posting this bug and creating the repo for reproducing the issue. This bug seems to have been introduced with https://github.com/getkirby/kirby/commit/de11f2a2e8598485119780ad331fa822d6ee0451 as Kirby does not support a use case where one would render a page in different languages in one row, hence these multi-language setups are a bit more unstable with this plugin (kirby updates can break the functionality). I'm working on a fix.

jonathan-reisdorf commented 10 months ago

Issue should be fixed with latest release 1.12.2. If that's not the case, feel free to reopen

Sunnyka98 commented 10 months ago

Hi @jonathan-reisdorf, The issue with the translation is fixed but now the performance is very low. I tests it with many pages (~2530) and the time it need to render is 20x times higher than in v1.12.1. Is it possible to get a better performance?

jonathan-reisdorf commented 10 months ago

Hi @Sunnyka98, thank you for checking. We could do the full reset just once when switching between two languages instead of what we do now - full reset before every page render (which should not be necessary when language stays the same). I will try that out later and let you know, the next days I have a very busy schedule but hopefully there is time towards the end of the week.

jonathan-reisdorf commented 9 months ago

Performance should be improved with latest release 1.12.3

paresy commented 8 months ago

Thank you so much. Performance is back to awesome 😄