0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-01-07 01:12:44 +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 template = async function(name, title='', props = {}){
const ogTags = []; const ogTags = [];
Object.entries(props.ogMeta).forEach(([key, value])=>{ const ogMeta = props.ogMeta ?? {};
Object.entries(ogMeta).forEach(([key, value])=>{
if(!value) return; if(!value) return;
const tag = `<meta property="og:${key}" content="${value}">`; const tag = `<meta property="og:${key}" content="${value}">`;
ogTags.push(tag); ogTags.push(tag);