(currentPage: Page)
| 124 | }; |
| 125 | |
| 126 | const getDescription = (currentPage: Page): string => { |
| 127 | let library = getLibraryLabel(getLibraryFromPage(currentPage)); |
| 128 | const pageTitle = |
| 129 | currentPage.exports?.title ?? currentPage.tableOfContents?.[0]?.title ?? currentPage.name; |
| 130 | const explicitDescription = (currentPage as any).description || currentPage.exports?.description; |
| 131 | if (explicitDescription) { |
| 132 | return explicitDescription as string; |
| 133 | } |
| 134 | if (currentPage.name === 'index.html' || currentPage.name.endsWith('/index.html')) { |
| 135 | return `Documentation for ${library || 'React Spectrum'}`; |
| 136 | } |
| 137 | return library |
| 138 | ? `Documentation for ${pageTitle} in ${library}.` |
| 139 | : `Documentation for ${pageTitle}.`; |
| 140 | }; |
| 141 | |
| 142 | const getFaviconUrl = (currentPage: Page): string => { |
| 143 | const library = getLibraryFromPage(currentPage); |
no test coverage detected