(title: string, projectName: string)
| 3 | const BASE_SUFFIX = ' | OpenPanel.dev'; |
| 4 | |
| 5 | function inject(title: string, projectName: string): string { |
| 6 | if (!title.endsWith(BASE_SUFFIX)) return title; |
| 7 | if (title.includes(` | ${projectName}${BASE_SUFFIX}`)) return title; |
| 8 | return title.replace(BASE_SUFFIX, ` | ${projectName}${BASE_SUFFIX}`); |
| 9 | } |
| 10 | |
| 11 | // Browser tab titles are set by each route's `head()` (server + client). |
| 12 | // Rather than threading project name through every route's loader/head, |