← back to Customdigitalmurals
seo: add per-page canonical + Open Graph + Twitter card (headCommon threads canonical+ogImage; home + /product/:handle redacted slug)
7d37cef70f0c998c54505e086de983aada831d4e · 2026-06-04 08:08:10 -0700 · Steve
Files touched
Diff
commit 7d37cef70f0c998c54505e086de983aada831d4e
Author: Steve <steve@designerwallcoverings.com>
Date: Thu Jun 4 08:08:10 2026 -0700
seo: add per-page canonical + Open Graph + Twitter card (headCommon threads canonical+ogImage; home + /product/:handle redacted slug)
---
server.js | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)
diff --git a/server.js b/server.js
index bea7e10..0c92d12 100644
--- a/server.js
+++ b/server.js
@@ -337,7 +337,7 @@ function ga4Script() {
<script>window.dataLayer=window.dataLayer||[];function gtag(){dataLayer.push(arguments);}gtag('js',new Date());gtag('config','${GA4_ID}');</script>`;
}
-function headCommon(title, desc) {
+function headCommon(title, desc, canonical='', ogImage='') {
return `<!doctype html>
<html lang="en">
<head>
@@ -345,6 +345,11 @@ function headCommon(title, desc) {
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>${escHtml(title)}</title>
<meta name="description" content="${escHtml(desc)}">
+${canonical?`<link rel="canonical" href="${escHtml(canonical)}">\n`:''}<meta property="og:type" content="website">
+<meta property="og:site_name" content="Custom Digital Murals">
+<meta property="og:title" content="${escHtml(title)}">
+<meta property="og:description" content="${escHtml(desc)}">
+${canonical?`<meta property="og:url" content="${escHtml(canonical)}">\n`:''}${ogImage?`<meta property="og:image" content="${escHtml(ogImage)}">\n`:''}<meta name="twitter:card" content="${ogImage?'summary_large_image':'summary'}">
<meta name="theme-color" content="#ffffff" media="(prefers-color-scheme: light)">
<meta name="theme-color" content="#0a0a0a" media="(prefers-color-scheme: dark)">
<script>(function(){try{var t=localStorage.getItem('cdm-theme');if(!t){t=window.matchMedia&&window.matchMedia('(prefers-color-scheme: dark)').matches?'dark':'light';}document.documentElement.setAttribute('data-theme',t);}catch(e){}})();</script>
@@ -529,7 +534,9 @@ function homePage() {
return `${headCommon(
'Custom Digital Murals — Free Samples, Trade Service | Designer Wallcoverings',
- 'Order custom digital wall murals printed to size. Hospitality, retail buildouts, residential statement walls. Free memo samples via Designer Wallcoverings. Expert trade service.'
+ 'Order custom digital wall murals printed to size. Hospitality, retail buildouts, residential statement walls. Free memo samples via Designer Wallcoverings. Expert trade service.',
+ 'https://customdigitalmurals.com/',
+ heroImg
)}
<body>
${headerHtml('home')}
@@ -747,7 +754,9 @@ function productPage(p) {
return `${headCommon(
`${p.title} — Order Free Sample | Custom Digital Murals`,
- `${p.title} from Designer Wallcoverings. Order a free memo sample. Trade service available. Large-format digital mural printed to your exact dimensions.`
+ `${p.title} from Designer Wallcoverings. Order a free memo sample. Trade service available. Large-format digital mural printed to your exact dimensions.`,
+ `https://customdigitalmurals.com/product/${redactVendorSlug(p.handle)}`,
+ mainImg
)}
<body>
${headerHtml('')}
← 13a98bb Scrub residual vendor names from products.json (title/vendor
·
back to Customdigitalmurals
·
banner: wire universal promo-banner require above express.st 5e3ad01 →