For a while there’s been some confusion around the best way to create new standalone pages in a plug-in and link them from a blog’s navigation (Hugo menu). While @sod’s new Search Space plug-in is in beta, I thought this might be a good opportunity to revisit this question and see if anyone has feedback about improvements we could make.
To summarize, a plug-in can create new pages, and when it does it has the option to automatically include it in a menu using Hugo front matter, or leave it up to the user to create a page redirect. Including the page automatically is restrictive, but pages that redirect somewhere don’t have a good UI currently. (It requires adding the full URL as the page content.)
I can think of a few ways to solve this:
- Improve the page/redirect UI. Maybe we should do this anyway.
- Add a plug-in setting that will show a checkbox to include the page the plug-in provides in the menu.
- Add a plug-in setting that exposes which pages it will create, and let Micro.blog provide some kind of UI for the user to choose from that when updating the navigation. Might be similar to how WordPress links to named pages in a menu.