Changeset 1ff0043 in Klonkt for src/views/shell.ejs


Ignore:
Timestamp:
06/28/2026 04:12:48 PM (2 months ago)
Author:
Robin Genis <roboburr@…>
Branches:
main
Children:
f79a471
Parents:
897c33b
Message:

fix(seo): canonical falls back to PUBLIC_BASE_URL + English placeholders

  • views/shell.ejs — <link rel=canonical> now uses the per-site override OR the .env base (ogOrigin/PUBLIC_BASE_URL), so the canonical works from .env without filling the SEO field
  • views/pages/admin-seo.ejs — placeholders jouw-domein.com -> yourdomain.com (was Dutch in an English app)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/views/shell.ejs

    r897c33b r1ff0043  
    4242}
    4343
    44 // ── Canonical URL (only when we have one configured) ─────────────
     44// ── Canonical URL: per-site override (admin SEO), else the .env base
     45//    (PUBLIC_BASE_URL, via ogOrigin → falls back to the request host) ──
    4546let _canonical = null;
    46 if (safeSite.canonical) {
    47   const _base = safeSite.canonical.replace(/\/+$/, '');
     47const _canonBase = safeSite.canonical || (typeof ogOrigin !== 'undefined' ? ogOrigin : '');
     48if (_canonBase) {
     49  const _base = _canonBase.replace(/\/+$/, '');
    4850  let _path = '/';
    4951  if (typeof post !== 'undefined' && post && post.slug) _path = '/' + post.slug;
Note: See TracChangeset for help on using the changeset viewer.