File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -26,9 +26,16 @@ export const siteSections: SiteSection[] = [
2626]
2727
2828// Convenience accessors (used by codegen)
29- export const guidesRoot = siteSections [ 0 ] ! . root
30- export const apiReferenceRoot = siteSections [ 1 ] ! . root
31- export const apiReferenceUrlPrefix = siteSections [ 1 ] ! . urlPrefix
29+ const guides = siteSections . find ( ( s ) => s . name === 'Guides' )
30+ const apiReference = siteSections . find ( ( s ) => s . name === 'API Reference' )
31+
32+ if ( guides == null || apiReference == null ) {
33+ throw new Error ( 'Missing required site section in config' )
34+ }
35+
36+ export const guidesRoot = guides . root
37+ export const apiReferenceRoot = apiReference . root
38+ export const apiReferenceUrlPrefix = apiReference . urlPrefix
3239
3340// Derived paths
3441export const apiReferenceSummaryPath = join ( apiReferenceRoot , 'SUMMARY.md' )
You can’t perform that action at this time.
0 commit comments