fix docs slugs (#3227)
Our slug generation code uses the stateful version of github slugger which assigns different names to different slugs e.g. `thing`, `thing-1`, `thing-2` each time it's called. This means that our links across pages are broken because the slugs get generated with a suffix. This replaces it with the non-stateful version instead.
This commit is contained in:
parent
72ae8ddefd
commit
d5dc306314
1 changed files with 2 additions and 4 deletions
|
@ -11,9 +11,7 @@ import {
|
||||||
DocSoftBreak,
|
DocSoftBreak,
|
||||||
} from '@microsoft/tsdoc'
|
} from '@microsoft/tsdoc'
|
||||||
import assert from 'assert'
|
import assert from 'assert'
|
||||||
import GithubSlugger from 'github-slugger'
|
import { slug as githubSlug } from 'github-slugger'
|
||||||
|
|
||||||
const slugs = new GithubSlugger()
|
|
||||||
|
|
||||||
import path from 'path'
|
import path from 'path'
|
||||||
import prettier from 'prettier'
|
import prettier from 'prettier'
|
||||||
|
@ -50,7 +48,7 @@ function isOnParentPage(itemKind: ApiItemKind) {
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getSlug(item: ApiItem): string {
|
export function getSlug(item: ApiItem): string {
|
||||||
return slugs.slug(item.displayName, true)
|
return githubSlug(item.displayName, true)
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getPath(item: ApiItem): string {
|
export function getPath(item: ApiItem): string {
|
||||||
|
|
Loading…
Reference in a new issue