Range over Sections catches drafts

I have a shortcode that creates a list of sections on my page. It ranges over them.

I noticed on my machine that after one of the recent updates, the shortcode started showing sections that are marked as drafts in the frontmatter (and these sections only include pages that are also drafts). This does not happen on version 0.55.6, which I use on the production server.

Is this intended behavior?

It depends on what your shortcode does.

Starting with v0.57.0, there were problems like what you describe but I think they are fixed in v0.59.0+. Also you may need to change .Pages to .Site.RegularPages in v0.57.0+.

Details are in the v0.57.0 release notes:

And in the release notes of all the versions after that up to and including v0.59.0.

1 Like