fix(dynamic.php.liquid): trim dynamic metadata

This commit is contained in:
Cory Dransfeldt 2025-05-07 12:54:18 -07:00
parent afa7144142
commit 19809e325c
No known key found for this signature in database
3 changed files with 14 additions and 14 deletions

View file

@ -1,15 +1,15 @@
<title><?= htmlspecialchars($pageTitle ?? "{{ pageTitle }}", ENT_QUOTES, 'UTF-8') ?> • {{ globals.site_name }}</title>
<meta name="description" content="<?= htmlspecialchars($pageDescription ?? '{{ pageDescription | escape }}', ENT_QUOTES, 'UTF-8') ?>" />
<meta property="og:title" content="<?= htmlspecialchars($pageTitle ?? '{{ pageTitle }}', ENT_QUOTES, 'UTF-8') ?> • {{ globals.site_name }}" />
<meta property="og:description" content="<?= htmlspecialchars($pageDescription ?? '{{ pageDescription | escape }}', ENT_QUOTES, 'UTF-8') ?>" />
<meta property="og:image" content="<?= htmlspecialchars("{{ globals.cdn_url }}" . ($ogImage ?? '{{ ogImage }}'), ENT_QUOTES, 'UTF-8') ?>" />
<meta property="og:url" content="<?= htmlspecialchars($fullUrl ?? '{{ fullUrl }}', ENT_QUOTES, 'UTF-8') ?>" />
<link rel="canonical" href="<?= htmlspecialchars($fullUrl ?? '{{ fullUrl }}', ENT_QUOTES, 'UTF-8') ?>" />
<title><?= htmlspecialchars(trim($pageTitle ?? "{{ pageTitle }}"), ENT_QUOTES, 'UTF-8') ?> • {{ globals.site_name }}</title>
<meta name="description" content="<?= htmlspecialchars(trim($pageDescription ?? '{{ pageDescription | escape }}'), ENT_QUOTES, 'UTF-8') ?>" />
<meta property="og:title" content="<?= htmlspecialchars(trim($pageTitle ?? '{{ pageTitle }}'), ENT_QUOTES, 'UTF-8') ?> • {{ globals.site_name }}" />
<meta property="og:description" content="<?= htmlspecialchars(trim($pageDescription ?? '{{ pageDescription | escape }}'), ENT_QUOTES, 'UTF-8') ?>" />
<meta property="og:image" content="<?= htmlspecialchars(trim("{{ globals.cdn_url }}" . ($ogImage ?? '{{ ogImage }}')), ENT_QUOTES, 'UTF-8') ?>" />
<meta property="og:url" content="<?= htmlspecialchars(trim($fullUrl ?? '{{ fullUrl }}'), ENT_QUOTES, 'UTF-8') ?>" />
<link rel="canonical" href="<?= htmlspecialchars(trim($fullUrl ?? '{{ fullUrl }}'), ENT_QUOTES, 'UTF-8') ?>" />
<?php if (!empty($pagination)): ?>
<?php if ($pagination['href']['next']): ?>
<link rel="next" href="<?= $pagination['href']['next'] ?>">
<?php if (!empty($pagination['href']['next'])): ?>
<link rel="next" href="<?= trim($pagination['href']['next']) ?>">
<?php endif; ?>
<?php if ($pagination['href']['previous']): ?>
<link rel="prev" href="<?= $pagination['href']['previous'] ?>">
<?php if (!empty($pagination['href']['previous'])): ?>
<link rel="prev" href="<?= trim($pagination['href']['previous']) ?>">
<?php endif; ?>
<?php endif; ?>