import stringifyLayoutPresets , { layoutPresets } from './layouts' ; import { sourcePresets } from './sources' ; const enabledLayouts = layoutPresets . map ( ( { id , expect , title } ) => ( { id , expect , title } ) ) ; const enabledSources = sourcePresets . reduce ( ( p , { id } ) => ( { ... p , [ id ] : [ enabledLayouts [ 0 ] . id , enabledLayouts [ 0 ] . id ] } ) , { } ) ; const templateConfig = { template_source_layouts : { ... enabledSources , youdao : [ enabledLayouts [ 1 ] . id , enabledLayouts [ 1 ] . id ] , } , template_crawler_layouts : { } , template_enabled_layouts : enabledLayouts , template_layouts : stringifyLayoutPresets , } ; export const prefixer = ( name ) : string => `template_${ name }` ; export default templateConfig ;