is present for clean multi-segment URLs like /post/:slug
if (strpos($html, ' ]*>/i', "$0\n ", $html, 1);
}
// Replace Title & Description
$html = preg_replace('/
]*>.*?<\/title>/si', '' . htmlspecialchars($fullTitle) . ' ', $html);
$html = preg_replace('/ ]*>/si', ' ', $html);
$html = preg_replace('/ ]*>/si', ' ', $html);
// Replace Canonical
$html = preg_replace('/ ]*>/si', ' ', $html);
// Replace OpenGraph tags
$html = preg_replace('/ ]*>/si', ' ', $html);
$html = preg_replace('/ ]*>/si', ' ', $html);
// Replace OpenGraph image tags cleanly
$ogImgTags = ' ' . "\n" .
' ' . "\n" .
' ' . "\n" .
' ';
$html = preg_replace('/ ]*>/si', '', $html);
$html = preg_replace('/ ]*>/si', $ogImgTags, $html);
$html = preg_replace('/ ]*>/si', ' ', $html);
$html = preg_replace('/ ]*>/si', ' ', $html);
// Replace Twitter Card tags
$html = preg_replace('/ ]*>/si', ' ', $html);
$html = preg_replace('/ ]*>/si', ' ', $html);
$html = preg_replace('/ ]*>/si', ' ', $html);
// Replace Schema.org NewsArticle JSON-LD
$schemaJson = json_encode([
'@context' => 'https://schema.org',
'@type' => 'NewsArticle',
'mainEntityOfPage' => [
'@type' => 'WebPage',
'@id' => $canonicalUrl
],
'headline' => $title,
'image' => [$image],
'datePublished' => $article['createdAt'] ?? '2026-09-08T00:00:00+05:45',
'dateModified' => $article['updatedAt'] ?? ($article['createdAt'] ?? '2026-09-08T00:00:00+05:45'),
'author' => [
'@type' => 'Person',
'name' => $article['source'] ?? ($article['author'] ?? 'Rojgar Desk')
],
'publisher' => [
'@type' => 'NewsMediaOrganization',
'name' => 'RojgarXpress',
'logo' => [
'@type' => 'ImageObject',
'url' => "$baseUrl/images/logo.svg"
]
],
'description' => $cleanSummary
], JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT);
$html = preg_replace('/', $html);
header('Content-Type: text/html; charset=utf-8');
echo $html;
exit;
}
// Fallback if news.html not found: render standalone rich meta page
?>
= htmlspecialchars($fullTitle) ?>
लोड हुँदैछ (Loading article)...
यदि केही क्षणमा नखुले यहाँ थिच्नुहोस् →