Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/ready-parrots-travel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"gitbook": patch
---

Fix icon resolution for page group
13 changes: 7 additions & 6 deletions packages/gitbook/src/lib/references.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -177,14 +177,15 @@ export async function resolveContentRef(
}
} else {
const parentPage = (resolvePageResult?.ancestors || []).slice(-1).pop();
// When the looked up ref was a page group we use the page group title as resolved ref text.
// Otherwise use the resolved page title.
text =
// When the looked up ref was a page group we use the page group to resolve title and icon.
// Otherwise use the resolved page title and icon.
const pageOrGroup =
parentPage && contentRef.page === parentPage.id && parentPage.type === 'group'
? parentPage.title
: page.title;
? parentPage
: page;
text = pageOrGroup.title;
emoji = isCurrentPage ? undefined : page.emoji;
icon = <PageIcon page={page} style={iconStyle} />;
icon = <PageIcon page={pageOrGroup} style={iconStyle} />;
}

return {
Expand Down