typemill / typemill

Typemill is a lightweight, flat-file CMS designed for simple, fast, and flexible website and eBook creation using Markdown.
https://typemill.net
MIT License
424 stars 60 forks source link

Incorrect item.keyPathArray values if there are unpublished items #442

Closed fujaru closed 2 months ago

fujaru commented 2 months ago

If some items in the navigation are unpublished, subsequent items will have incorrect keyPathArray values as if all items are published. Tested in Typemill v2.1.2

Steps to reproduce:

  1. In the default installation there are two top level folders, "Welcome" and "Cyanine". Unpublish the "Welcome" folder.
  2. Go to frontend and open the "Cyanine" page
  3. Try to print out item.keyPathArray on the page. item.keyPathArray[0] for "Cyanine" page outputs "1" instead of "0" even though there is only one item in the navigation variable.
trendschau commented 2 months ago

Thank you for reporting, I fixed and refactored it. Will be published with version 2.2.2 or 2.3.0.

trendschau commented 2 months ago

published fix with version 2.2.2 today