Closed tobyhodges closed 10 months ago
Is there a reason why you would list setup.md
? What would you expect to see from this? It gets stripped from the menus because it's a section in the index and not a separate page.
I can imagine circumstances in which a person would do this accidentally e.g. if they add a bunch of files to learners/
and then decide they want to control the order those pages appear in the dropdown menu. They might forget that setup.md doesn't need to be included, and add it to the config.yaml
based on the list of filenames in the directory. I think that's a realistic scenario.
But mostly I wanted to report this because of the inconsistency in behaviour between my local setup and the Actions workflow, which combined with the non-obvious error message and the fact that the issue seemed to spring up spontaneously earlier this week, made it very difficult to debug.
Ah, gotcha. That's a very good point. Thank you for finding the root cause of this and creating a MWE.
In particular, this bug was just added in the update to the 404 page that addressed https://github.com/carpentries/sandpaper/issues/498.
The nitty gritty of what's happening is that, when the 404 page is built from a deployment function (one that starts with ci_
), then it will convert all of the relative links in the navigation to absolute URLs.
The problem arises when there is nothing to be had in one of the navigation menus for the learners, which can occur in two situations:
learners/
folder is setup.md
learners:
item of config.yaml
is setup.md
If you have the following config, it will work as expected.
learners:
- reference.md
- setup.md
That being said, this is definitely a bug that should be rectified.
Because this is causing existing builds to fail, I will add a quick fix, but it does beg the question: what happens when someone does not want anything to appear in the "more" section? At the moment, there's no good way to do that.
The problem arises when there is nothing to be had in one of the navigation menus for the learners, which can occur in two situations:
- the only file in the learners/ folder is setup.md
- the only file listed in the learners: item of config.yaml is setup.md
Indeed that makes it much less likely to come up. Thanks for clarifying.
Because this is causing existing builds to fail, I will add a quick fix, but it does beg the question: what happens when someone does not want anything to appear in the "more" section? At the moment, there's no good way to do that.
My immediate thought is that the More dropdown should not be displayed if there's nothing to populate it. If that is challenging to implement, I would suggest some subtly-styled placeholder text that says something like "nothing here".
This was fixed in https://github.com/carpentries/sandpaper/pull/520
Although it does not cause any problem when I build locally, listing
setup.md
underlearners:
inconfig.yaml
causes the Build and Deploy workflow to fail on GitHub with the following cryptic error message:I have created a minimal example at https://github.com/tobyhodges/upgraded-engine
Here is the output of
sessionInfo()
on my local system, wheresandpaper::serve()
runs without issue: