const template = async function(name, title='', props = {}){ const ogTags = []; const ogMeta = props.ogMeta ?? {}; Object.entries(ogMeta).forEach(([key, value])=>{ if(!value) return; const tag = ``; ogTags.push(tag); }); const ogMetaTags = ogTags.join('\n'); const ssrModule = await import(`../build/${name}/ssr.cjs`); return ` ${ogMetaTags} ${title.length ? `${title} - The Homebrewery`: 'The Homebrewery - NaturalCrit'}
${ssrModule.default(props)}
`; }; export default template;