Simpletest way to hide a specific page

I have two pages, page1,py and page2.py in my pages folder. page1.py calls page2.py, so I want to hide page2.py from the sidebar/side navigation. What is the simplest way to do this?

  1. There’s st_pages, but that doesn’t work in a docker container for some reason
  2. There are multiple posts on hiding the entire sidebar and recreating it in a custom way, but these are brittle. Sometimes both sidebars show up.
  3. I’ve tried mucking around with the CSS + Javascript to hide a single element, but no success so far.

Happy to share more details on my attempts, but there ought to be a very simple way to hide a page. Or if I can move page2.py to a subfolder in page and then have page1.py call it via st.switch_page(“pages/subpages/page2.py”) that would work too, but seems like you can only switch_page to whatever is within the pages folder.