mirror of
https://github.com/Crosstalk-Solutions/project-nomad.git
synced 2026-03-28 03:29:25 +01:00
fix(docs): display FAQ as uppercase in sidebar
Add title override map so 'faq' displays as 'FAQ' instead of 'Faq'. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
184e96df06
commit
f3c16c674c
|
|
@ -81,9 +81,17 @@ export class DocsService {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static readonly TITLE_OVERRIDES: Record<string, string> = {
|
||||||
|
'faq': 'FAQ',
|
||||||
|
}
|
||||||
|
|
||||||
private prettify(filename: string) {
|
private prettify(filename: string) {
|
||||||
|
const slug = filename.replace(/\.md$/, '')
|
||||||
|
if (DocsService.TITLE_OVERRIDES[slug]) {
|
||||||
|
return DocsService.TITLE_OVERRIDES[slug]
|
||||||
|
}
|
||||||
// Remove hyphens, underscores, and file extension
|
// Remove hyphens, underscores, and file extension
|
||||||
const cleaned = filename.replace(/_/g, ' ').replace(/\.md$/, '').replace(/-/g, ' ')
|
const cleaned = slug.replace(/_/g, ' ').replace(/-/g, ' ')
|
||||||
// Convert to Title Case
|
// Convert to Title Case
|
||||||
const titleCased = cleaned.replace(/\b\w/g, (char) => char.toUpperCase())
|
const titleCased = cleaned.replace(/\b\w/g, (char) => char.toUpperCase())
|
||||||
return titleCased.charAt(0).toUpperCase() + titleCased.slice(1)
|
return titleCased.charAt(0).toUpperCase() + titleCased.slice(1)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user