Hello.
I was trying to generate some links on my site but I hit an issue when generating a link to a page in draft. When building for prod this fails since draft pages are removed completely from the search tree.
I saw this issue on Github. It was stale so I patched this for me by adding an optinal allow_missing parameter to get _page similar to the one in images.
I wanted to know if this could be merged or if there’s already a better way to address this use case.
Thanks and hello.
opened 06:26PM - 19 Sep 22 UTC
help wanted
good first issue
# Bug Report
## Environment
Zola version: 0.16.0
## Expected Behavior
… This function is probably working as originally intended, so what I am asking for may actually be a new feature unless there is another way to accomplish this?
## Current Behavior
This started with a feature request to not show certain menu items if those pages are marked as draft. https://github.com/Jieiku/abridge/issues/92
I created a solution:
https://github.com/Jieiku/abridge/commit/bca64259827edb25a19c4b910ab28907b0b29d93
but if I set draft = true for about.md then zola no longer builds/serves the site.
```
Building site...
Checking all internal links with anchors.
> Successfully checked 1 internal link(s) with anchors.
-> Creating 12 pages (2 orphan) and 2 sections
Error: Failed to serve the site
Error: Failed to render section '/home/jieiku/.dev/abridge/content/posts/_index.md'
Error: Reason: Failed to render 'posts.html' (error happened in a parent template)
Error: Reason: Function call 'get_page' failed
Error: Reason: Page `pages/about.md` not found.
```
## Step to reproduce
```sh
git clone -b menu-draft-check https://github.com/Jieiku/abridge
cd abridge
zola serve
```
The site will serve/build if you set `draft = false` in `content/pages/about.md`
If there is another way of doing this that I have not figured out then I appologize for the report, I did review the zola and tera documentation first and spent a couple of days thinking about the issue.