DEV: Change enable_sidebar query param to navigation_menu (#20368)

What does this change do?

This commit the client to override the navigation menu setting
configured by the site temporarily based on the value of the
`navigation_menu` query param. The new query param replaces the old
`enable_sidebar` query param.

Why do we need this change?

The motivation here is to allow theme maintainers to quickly preview
what the site will look like with the various navigation menu site
setting.
This commit is contained in:
Alan Guo Xiang Tan
2023-02-21 09:59:56 +08:00
committed by GitHub
parent 509fee0f5a
commit c47015b861
11 changed files with 90 additions and 63 deletions

View File

@@ -252,9 +252,9 @@ async function buildFromBootstrap(proxy, baseURL, req, response, preload) {
url.searchParams.append("safe_mode", reqUrlSafeMode);
}
const enableSidebar = forUrlSearchParams.get("enable_sidebar");
if (enableSidebar) {
url.searchParams.append("enable_sidebar", enableSidebar);
const navigationMenu = forUrlSearchParams.get("navigation_menu");
if (navigationMenu) {
url.searchParams.append("navigation_menu", navigationMenu);
}
const reqUrlPreviewThemeId = forUrlSearchParams.get("preview_theme_id");