@@ -118,10 +118,8 @@ import { RenderFlags } from "../../../command/render/types.ts";
118118import { formatLanguage } from "../../../core/language.ts" ;
119119import { kComments } from "../../../format/html/format-html-shared.ts" ;
120120import { resolvePageFooter } from "../website/website-shared.ts" ;
121- import {
122- NavigationItemObject ,
123- PageFooterRegion ,
124- } from "../../../resources/types/schema-types.ts" ;
121+ import { Zod } from "../../../resources/types/zod/schema-types.ts" ;
122+ import { PageFooterRegion } from "../../../resources/types/schema-types.ts" ;
125123import { projectType } from "../project-types.ts" ;
126124import { BookRenderItem , BookRenderItemType } from "./book-types.ts" ;
127125import { isAbsoluteRef } from "../../../core/http.ts" ;
@@ -145,7 +143,7 @@ export async function bookProjectConfig(
145143 if ( ! site [ kSiteFavicon ] ) {
146144 const brand = await project . resolveBrand ( ) ;
147145 if ( brand ?. light ) {
148- site [ kSiteFavicon ] = getFavicon ( brand . light ) ; //
146+ site [ kSiteFavicon ] = getFavicon ( brand . light ) ; //
149147 }
150148 }
151149 site [ kSiteUrl ] = book [ kSiteUrl ] ;
@@ -259,13 +257,12 @@ export async function bookProjectConfig(
259257 const footerFiles : string [ ] = [ ] ;
260258 const pageFooter = resolvePageFooter ( config ) ;
261259 const addFooterItems = ( region ?: PageFooterRegion ) => {
262- if ( region ) {
263- for ( const item of region ) {
264- if ( typeof item !== "string" ) {
265- const navItem = item as NavigationItemObject ;
266- if ( navItem . href && ! isAbsoluteRef ( navItem . href ) ) {
267- footerFiles . push ( navItem . href ) ;
268- }
260+ if ( ! region ) return ;
261+ for ( const item of region ) {
262+ if ( typeof item !== "string" ) {
263+ const navItem = Zod . NavigationItemObject . parse ( item ) ;
264+ if ( navItem . href && ! isAbsoluteRef ( navItem . href ) ) {
265+ footerFiles . push ( navItem . href ) ;
269266 }
270267 }
271268 }
0 commit comments