1
0
mirror of https://github.com/prometheus/docs.git synced 2026-02-05 15:45:27 +01:00

Merge pull request #2660 from prometheus/more-navtitle-usage

Also use `navTitle` over `title` in prev/next buttons and breadcrumbs
This commit is contained in:
Julius Volz
2025-05-28 15:55:56 +02:00
committed by GitHub
2 changed files with 3 additions and 3 deletions

View File

@@ -41,7 +41,7 @@ export default function PrevNextEditButtons({
whiteSpace: "normal",
}}
>
{currentPage.prev.title}
{currentPage.prev.navTitle ?? currentPage.prev.title}
</Text>
</Stack>
</Button>
@@ -100,7 +100,7 @@ export default function PrevNextEditButtons({
whiteSpace: "normal",
}}
>
{currentPage.next.title}
{currentPage.next.navTitle ?? currentPage.next.title}
</Text>
</Stack>
</Button>

View File

@@ -58,7 +58,7 @@ function resolveRelativeUrl(currentPath: string, relativeUrl: string): string {
function pagefindBreadcrumbsTitle(currentPage: DocMetadata) {
const titles: string[] = [];
for (let node = currentPage; node; node = node.parent!) {
titles.unshift(node.title);
titles.unshift(node.navTitle ?? node.title);
}
return titles.join(" > ");
}