diff --git a/api/outfitPageSSR.js b/api/outfitPageSSR.js index 4af0ee1..68a2898 100644 --- a/api/outfitPageSSR.js +++ b/api/outfitPageSSR.js @@ -58,6 +58,8 @@ async function handle(req, res) { return sendHtml(res, initialHtml, 404); } + const outfitName = outfit.name || "Untitled outfit"; + // Okay, now let's rewrite the HTML to include some outfit data! // // WARNING!!! @@ -69,7 +71,7 @@ async function handle(req, res) { // Add the outfit name to the title. html = html.replace( /(.*)<\/title>/, - `<title>${escapeHtml(outfit.name)} | Dress to Impress` + `${escapeHtml(outfitName)} | Dress to Impress` ); // Add sharing meta tags just before the tag. @@ -85,7 +87,7 @@ async function handle(req, res) { `/v/${encodeURIComponent(updatedAtTimestamp)}` + `/600.png`; const metaTags = ` - +