Skip to content

Commit 837f861

Browse files
committed
search - control navbar search crumb merging with configuration
1 parent fd3aacf commit 837f861

File tree

7 files changed

+39
-16
lines changed

7 files changed

+39
-16
lines changed

src/project/types/website/website-search.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,13 @@ export async function updateSearchIndex(
252252
// link that points to this page / sidebar. If so, inject that level
253253
// into the crumbs as well. An attempt at improving #7803 and providing
254254
// better crumbs
255-
if (crumbs && sidebar) {
255+
// deno-lint-ignore no-explicit-any
256+
const mergeNavBarSearchCrumbs = (outputFile.format.metadata as any)
257+
?.website?.search?.["merge-navbar-crumbs"];
258+
if (
259+
mergeNavBarSearchCrumbs !== false &&
260+
crumbs && sidebar
261+
) {
256262
const navItem = navbarItemForSidebar(sidebar, outputFile.format);
257263
if (navItem) {
258264
if (typeof navItem === "object") {

src/resources/editor/tools/vs-code.mjs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9574,6 +9574,11 @@ var require_yaml_intelligence_resources = __commonJS({
95749574
schema: "boolean",
95759575
description: "Provide button for copying search link"
95769576
},
9577+
"merge-navbar-crumbs": {
9578+
schema: "boolean",
9579+
default: true,
9580+
description: "When false, do not merge navbar crumbs into the crumbs in `search.json`."
9581+
},
95779582
"keyboard-shortcut": {
95789583
maybeArrayOf: {
95799584
string: {
@@ -22914,8 +22919,6 @@ var require_yaml_intelligence_resources = __commonJS({
2291422919
"If <code>true</code>, force the presence of the OJS runtime. If\n<code>false</code>, force the absence instead. If unset, the OJS runtime\nis included only if OJS cells are present in the document.",
2291522920
"Use the specified file as a style reference in producing a docx,\npptx, or odt file.",
2291622921
"Branding information to use for this document. If a string, the path\nto a brand file. If false, don\u2019t use branding on this document. If an\nobject, an inline brand definition, or an object with light and dark\nbrand paths or definitions.",
22917-
"The path to a light brand file or an inline light brand\ndefinition.",
22918-
"The path to a dark brand file or an inline dark brand definition.",
2291922922
"Theme name, theme scss file, or a mix of both.",
2292022923
"The light theme name, theme scss file, or a mix of both.",
2292122924
"The light theme name, theme scss file, or a mix of both.",
@@ -24248,12 +24251,12 @@ var require_yaml_intelligence_resources = __commonJS({
2424824251
mermaid: "%%"
2424924252
},
2425024253
"handlers/mermaid/schema.yml": {
24251-
_internalId: 196120,
24254+
_internalId: 194252,
2425224255
type: "object",
2425324256
description: "be an object",
2425424257
properties: {
2425524258
"mermaid-format": {
24256-
_internalId: 196112,
24259+
_internalId: 194244,
2425724260
type: "enum",
2425824261
enum: [
2425924262
"png",
@@ -24269,7 +24272,7 @@ var require_yaml_intelligence_resources = __commonJS({
2426924272
exhaustiveCompletions: true
2427024273
},
2427124274
theme: {
24272-
_internalId: 196119,
24275+
_internalId: 194251,
2427324276
type: "anyOf",
2427424277
anyOf: [
2427524278
{

src/resources/editor/tools/yaml/web-worker.js

Lines changed: 8 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/resources/editor/tools/yaml/yaml-intelligence-resources.json

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2546,6 +2546,11 @@
25462546
"schema": "boolean",
25472547
"description": "Provide button for copying search link"
25482548
},
2549+
"merge-navbar-crumbs": {
2550+
"schema": "boolean",
2551+
"default": true,
2552+
"description": "When false, do not merge navbar crumbs into the crumbs in `search.json`."
2553+
},
25492554
"keyboard-shortcut": {
25502555
"maybeArrayOf": {
25512556
"string": {
@@ -15886,8 +15891,6 @@
1588615891
"If <code>true</code>, force the presence of the OJS runtime. If\n<code>false</code>, force the absence instead. If unset, the OJS runtime\nis included only if OJS cells are present in the document.",
1588715892
"Use the specified file as a style reference in producing a docx,\npptx, or odt file.",
1588815893
"Branding information to use for this document. If a string, the path\nto a brand file. If false, don’t use branding on this document. If an\nobject, an inline brand definition, or an object with light and dark\nbrand paths or definitions.",
15889-
"The path to a light brand file or an inline light brand\ndefinition.",
15890-
"The path to a dark brand file or an inline dark brand definition.",
1589115894
"Theme name, theme scss file, or a mix of both.",
1589215895
"The light theme name, theme scss file, or a mix of both.",
1589315896
"The light theme name, theme scss file, or a mix of both.",
@@ -17220,12 +17223,12 @@
1722017223
"mermaid": "%%"
1722117224
},
1722217225
"handlers/mermaid/schema.yml": {
17223-
"_internalId": 196120,
17226+
"_internalId": 194252,
1722417227
"type": "object",
1722517228
"description": "be an object",
1722617229
"properties": {
1722717230
"mermaid-format": {
17228-
"_internalId": 196112,
17231+
"_internalId": 194244,
1722917232
"type": "enum",
1723017233
"enum": [
1723117234
"png",
@@ -17241,7 +17244,7 @@
1724117244
"exhaustiveCompletions": true
1724217245
},
1724317246
"theme": {
17244-
"_internalId": 196119,
17247+
"_internalId": 194251,
1724517248
"type": "anyOf",
1724617249
"anyOf": [
1724717250
{

src/resources/schema/definitions.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -858,6 +858,10 @@
858858
copy-button:
859859
schema: boolean
860860
description: "Provide button for copying search link"
861+
merge-navbar-crumbs:
862+
schema: boolean
863+
default: true
864+
description: "When false, do not merge navbar crumbs into the crumbs in `search.json`."
861865
keyboard-shortcut:
862866
maybeArrayOf:
863867
string:

src/resources/schema/json-schemas.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -935,6 +935,9 @@
935935
"copy-button": {
936936
"type": "boolean"
937937
},
938+
"merge-navbar-crumbs": {
939+
"type": "boolean"
940+
},
938941
"keyboard-shortcut": {
939942
"anyOf": [
940943
{

src/resources/types/schema-types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -513,6 +513,7 @@ The user’s cookie preferences will automatically control Google Analytics (if
513513
search?: boolean | {
514514
"collapse-after"?: number;
515515
"copy-button"?: boolean;
516+
"merge-navbar-crumbs"?: boolean;
516517
"keyboard-shortcut"?: MaybeArrayOf<
517518
string /* One or more keys that will act as a shortcut to launch search (single characters) */
518519
>;

0 commit comments

Comments
 (0)