mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-08 18:22:40 +00:00
Move fix to template.js
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);
|
||||||
|
|||||||
@@ -415,7 +415,7 @@ app.use(asyncHandler(async (req, res, next)=>{
|
|||||||
enable_v3 : config.get('enable_v3'),
|
enable_v3 : config.get('enable_v3'),
|
||||||
enable_themes : config.get('enable_themes'),
|
enable_themes : config.get('enable_themes'),
|
||||||
config : configuration,
|
config : configuration,
|
||||||
ogMeta : req.ogMeta ?? {}
|
ogMeta : req.ogMeta
|
||||||
};
|
};
|
||||||
const title = req.brew ? req.brew.title : '';
|
const title = req.brew ? req.brew.title : '';
|
||||||
const page = await templateFn('homebrew', title, props)
|
const page = await templateFn('homebrew', title, props)
|
||||||
|
|||||||
Reference in New Issue
Block a user