From a674caa520d881befcf0e72e91f33b6f8e1913ca Mon Sep 17 00:00:00 2001 From: Louis Lam Date: Tue, 31 May 2022 22:53:48 +0800 Subject: [PATCH] [Status Page] Add og meta tags --- server/model/status_page.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/server/model/status_page.js b/server/model/status_page.js index 6b3fcc81d..ebab30165 100644 --- a/server/model/status_page.js +++ b/server/model/status_page.js @@ -36,9 +36,10 @@ class StatusPage extends BeanModel { */ static renderHTML(indexHTML, statusPage) { const $ = cheerio.load(indexHTML); + const description155 = statusPage.description.substring(0, 155); $("title").text(statusPage.title); - $("meta[name=description]").attr("content", statusPage.description.substring(0, 155)); + $("meta[name=description]").attr("content", description155); if (statusPage.icon) { $("link[rel=icon]") @@ -48,6 +49,10 @@ class StatusPage extends BeanModel { const head = $("head"); + // OG Meta Tags + head.append(``); + head.append(``); + return $.root().html(); }