From c2637a757656454a6b32c7b30999aead5945fd97 Mon Sep 17 00:00:00 2001 From: Gazook89 <58999374+Gazook89@users.noreply.github.com> Date: Tue, 29 Nov 2022 11:27:15 -0600 Subject: [PATCH 1/4] fix og:image and og:site_name --- server/app.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server/app.js b/server/app.js index f847ac2dc..70c1174cd 100644 --- a/server/app.js +++ b/server/app.js @@ -78,10 +78,10 @@ const faqText = require('fs').readFileSync('faq.md', 'utf8'); String.prototype.replaceAll = function(s, r){return this.split(s).join(r);}; const defaultMetaTags = { - siteName : 'The Homebrewery - Make your Homebrew content look legit!', + site_name : 'The Homebrewery - Make your Homebrew content look legit!', title : 'The Homebrewery', description : 'A NaturalCrit Tool for Homebrews', - thumbnail : `${config.get('publicUrl')}/thumbnail.png`, + image : `${config.get('publicUrl')}/thumbnail.png`, type : 'website' }; @@ -149,7 +149,7 @@ app.get('/changelog', async (req, res, next)=>{ req.ogMeta = { ...defaultMetaTags, title : 'Changelog', description : 'Development changelog.', - thumbnail : null + image : null }; splitTextStyleAndMetadata(req.brew); From 9647fbcc746b7d47ddb8a5fd41bcc6f0c200edb2 Mon Sep 17 00:00:00 2001 From: Gazook89 <58999374+Gazook89@users.noreply.github.com> Date: Tue, 29 Nov 2022 19:12:54 -0600 Subject: [PATCH 2/4] change default image on a few pages, and default description. --- server/app.js | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/server/app.js b/server/app.js index 70c1174cd..49290727b 100644 --- a/server/app.js +++ b/server/app.js @@ -80,7 +80,7 @@ String.prototype.replaceAll = function(s, r){return this.split(s).join(r);}; const defaultMetaTags = { site_name : 'The Homebrewery - Make your Homebrew content look legit!', title : 'The Homebrewery', - description : 'A NaturalCrit Tool for Homebrews', + description : 'A NaturalCrit Tool for creating authentic Homebrews using Markdown.', image : `${config.get('publicUrl')}/thumbnail.png`, type : 'website' }; @@ -148,8 +148,7 @@ app.get('/changelog', async (req, res, next)=>{ req.ogMeta = { ...defaultMetaTags, title : 'Changelog', - description : 'Development changelog.', - image : null + description : 'Development changelog.' }; splitTextStyleAndMetadata(req.brew); @@ -208,8 +207,7 @@ app.get('/user/:username', async (req, res, next)=>{ req.ogMeta = { ...defaultMetaTags, title : `${req.params.username}'s Collection`, - description : 'View my collection of homebrew on the Homebrewery.', - image : null + description : 'View my collection of homebrew on the Homebrewery.' // type : could be 'profile'? }; @@ -274,7 +272,7 @@ app.get('/edit/:id', asyncHandler(getBrew('edit')), (req, res, next)=>{ req.ogMeta = { ...defaultMetaTags, title : req.brew.title || 'Untitled Brew', description : req.brew.description || 'No description.', - image : req.brew.thumbnail || null, + image : req.brew.thumbnail || `${config.get('publicUrl')}/thumbnail.png`, type : 'article' }; @@ -292,8 +290,7 @@ app.get('/new/:id', asyncHandler(getBrew('share')), (req, res, next)=>{ req.ogMeta = { ...defaultMetaTags, title : 'New', - description : 'Start crafting your homebrew on the Homebrewery!', - image : null + description : 'Start crafting your homebrew on the Homebrewery!' }; return next(); @@ -306,7 +303,7 @@ app.get('/share/:id', asyncHandler(getBrew('share')), asyncHandler(async (req, r req.ogMeta = { ...defaultMetaTags, title : req.brew.title || 'Untitled Brew', description : req.brew.description || 'No description.', - image : req.brew.thumbnail || null, + image : req.brew.thumbnail || `${config.get('publicUrl')}/thumbnail.png`, type : 'article' }; @@ -377,8 +374,7 @@ app.get('/account', asyncHandler(async (req, res, next)=>{ req.ogMeta = { ...defaultMetaTags, title : `Account Page`, - description : null, - image : null + description : null }; return next(); From 3a4c2d8f13c295b723f1a910726d62f073548228 Mon Sep 17 00:00:00 2001 From: Gazook89 <58999374+Gazook89@users.noreply.github.com> Date: Thu, 1 Dec 2022 10:58:27 -0600 Subject: [PATCH 3/4] change image property to reference default image property Co-authored-by: Trevor Buckner --- server/app.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/app.js b/server/app.js index 49290727b..8e86d5ec9 100644 --- a/server/app.js +++ b/server/app.js @@ -272,7 +272,8 @@ app.get('/edit/:id', asyncHandler(getBrew('edit')), (req, res, next)=>{ req.ogMeta = { ...defaultMetaTags, title : req.brew.title || 'Untitled Brew', description : req.brew.description || 'No description.', - image : req.brew.thumbnail || `${config.get('publicUrl')}/thumbnail.png`, + image : req.brew.thumbnail || defaultMetaTags.image, + type : 'article' }; From 3b6d3963f18e7acfb96fa477f0684f905a11fd44 Mon Sep 17 00:00:00 2001 From: Gazook89 <58999374+Gazook89@users.noreply.github.com> Date: Thu, 1 Dec 2022 11:01:40 -0600 Subject: [PATCH 4/4] point to defaultMetatags.image --- server/app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/app.js b/server/app.js index 8e86d5ec9..8d00ab21f 100644 --- a/server/app.js +++ b/server/app.js @@ -304,7 +304,7 @@ app.get('/share/:id', asyncHandler(getBrew('share')), asyncHandler(async (req, r req.ogMeta = { ...defaultMetaTags, title : req.brew.title || 'Untitled Brew', description : req.brew.description || 'No description.', - image : req.brew.thumbnail || `${config.get('publicUrl')}/thumbnail.png`, + image : req.brew.thumbnail || defaultMetaTags.image, type : 'article' };