Skip to content

Commit 2757c0b

Browse files
committed
Remove sdk-reference
1 parent 5fd4dd3 commit 2757c0b

2 files changed

Lines changed: 6 additions & 16 deletions

File tree

src/layouts/sdk-reference.hbs

Lines changed: 0 additions & 3 deletions
This file was deleted.

src/lib/reference.ts

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,15 @@ import {
1111
} from './layout/index.js'
1212
import { PathMetadataSchema } from './path-metadata.js'
1313

14-
const sdks: Array<'javascript'> = []
15-
1614
type Metadata = Partial<Pick<Blueprint, 'routes' | 'resources'>>
1715

1816
type File = ApiEndpointLayoutContext &
1917
ApiRouteLayoutContext &
2018
ApiNamespaceLayoutContext & { layout: string }
2119

20+
const rootPath = 'api'
21+
const indexFile = 'README.md'
22+
2223
export const reference = (
2324
files: Metalsmith.Files,
2425
metalsmith: Metalsmith,
@@ -43,7 +44,7 @@ export const reference = (
4344

4445
const namespacePaths = getNamespacePaths(blueprint.routes)
4546
for (const path of namespacePaths) {
46-
const k = `api${path}/README.md`
47+
const k = `${rootPath}${path}/${indexFile}`
4748
files[k] = { contents: Buffer.from('\n') }
4849
const file = files[k] as unknown as File
4950
file.layout = 'api-namespace.hbs'
@@ -64,7 +65,7 @@ export const reference = (
6465
if (route.isUndocumented) continue
6566
if (pathMetadata[route.path]?.title == null) continue
6667

67-
const k = `api${route.path}/README.md`
68+
const k = `${rootPath}${route.path}/${indexFile}`
6869
files[k] = { contents: Buffer.from('\n') }
6970
const file = files[k] as unknown as File
7071
file.layout = 'api-route.hbs'
@@ -74,19 +75,11 @@ export const reference = (
7475
if (endpoint.isUndocumented) continue
7576
if (endpoint.title.length === 0) continue
7677

77-
const k = `api${endpoint.path}.md`
78+
const k = `${rootPath}${endpoint.path}.md`
7879
files[k] = { contents: Buffer.from('\n') }
7980
const file = files[k] as unknown as File
8081
file.layout = 'api-endpoint.hbs'
8182
setEndpointLayoutContext(file, endpoint, blueprint.actionAttempts)
82-
83-
for (const sdk of sdks) {
84-
const k = `sdk/${sdk}${endpoint.path}.md`
85-
files[k] = { contents: Buffer.from('\n') }
86-
const file = files[k] as unknown as File
87-
file.layout = 'sdk-reference.hbs'
88-
setEndpointLayoutContext(file, endpoint, blueprint.actionAttempts)
89-
}
9083
}
9184
}
9285
}

0 commit comments

Comments
 (0)