@rigel-cms/rigel 1.2.1 → 1.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -31,7 +31,6 @@ export function navigationKey(target: Selection): string {
|
|
|
31
31
|
export function buildSidebar(manifest: Manifest, message: Translator = systemMessage): SidebarNode[] {
|
|
32
32
|
const link = (target: SidebarTarget, label: string): SidebarLink => ({ kind: "link", target, label });
|
|
33
33
|
const types = manifest.schema?.documents ?? [];
|
|
34
|
-
const pageTypes = types.filter(type => !type.shared);
|
|
35
34
|
const pages = manifest.pages.filter(page => !page.shared);
|
|
36
35
|
const categories = [...new Set(pages.map(page => page.category).filter((category): category is string => !!category))].sort();
|
|
37
36
|
const defaults: SidebarNode[] = [
|
|
@@ -39,7 +38,6 @@ export function buildSidebar(manifest: Manifest, message: Translator = systemMes
|
|
|
39
38
|
link({ kind: "pages" }, message("system.sidebar.pages")),
|
|
40
39
|
...(manifest.collections ?? []).map(collection => link({ kind: "collection", name: collection.name }, collection.label)),
|
|
41
40
|
...categories.map(category => link({ kind: "pages", category }, category)),
|
|
42
|
-
...pageTypes.slice(1).map(type => link({ kind: "documents", type: type.name }, type.title)),
|
|
43
41
|
{ kind: "heading", label: message("system.sidebar.shared") },
|
|
44
42
|
...types.filter(type => type.shared && !type.singleton).map(type => link({ kind: "documents", type: type.name }, type.title)),
|
|
45
43
|
...manifest.pages.filter(page => page.shared).map(page => link({ kind: "page", slug: page.slug }, page.label)),
|