mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-07 01:12:44 +00:00
Merge pull request #2499 from G-Ambatte/fixMissingMetaTagsCrash-#2498
Fix template.js crash when ogMeta undefined
This commit is contained in:
@@ -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);
|
||||||
|
|||||||
Reference in New Issue
Block a user