0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2025-12-24 14:12:40 +00:00
Fix template.js crash when ogMeta undefined
This commit is contained in:
Trevor Buckner
2022-11-13 15:46:25 -05:00
committed by GitHub

View File

@@ -1,6 +1,7 @@
const template = async function(name, title='', props = {}){
const ogTags = [];
Object.entries(props.ogMeta).forEach(([key, value])=>{
const ogMeta = props.ogMeta ?? {};
Object.entries(ogMeta).forEach(([key, value])=>{
if(!value) return;
const tag = `<meta property="og:${key}" content="${value}">`;
ogTags.push(tag);