<?php
require_once __DIR__ . '/../init.php';
header('Content-Type: text/html; charset=utf-8');
$lang = m_get_session('lang') ? m_get_session('lang') : lang_is_default('lang_code');
$url = m_a_g('slug') ?: '';
$post = null;
if ($url !== '') { $post = post_with_slug($url, $lang); }
?>
<!doctype html>
<html lang="<?= htmlspecialchars($lang, ENT_QUOTES, 'UTF-8') ?>">
<head>
  <meta charset="utf-8">
  <?php if (function_exists('render_seo_tags')) { render_seo_tags($post, $lang); } ?>
</head>
<body>
  <h1>SEO Test</h1>
  <p>Dil: <b><?= htmlspecialchars($lang, ENT_QUOTES, 'UTF-8') ?></b></p>
  <p>Slug: <b><?= htmlspecialchars($url, ENT_QUOTES, 'UTF-8') ?></b></p>
  <p>Canonical beklenen: <?= htmlspecialchars(rtrim(DOMAIN,'/') . ($post && !empty($post['sef']) ? '/' . ltrim($post['sef'],'/') : ''), ENT_QUOTES, 'UTF-8') ?></p>
  <hr>
  <p>Meta/OG/Twitter/hreflang/JSON-LD yukarıda &lt;head&gt; içinde üretildi.</p>
  <p>Kontrol araçları: Google Rich Results Test, Twitter Card Validator.</p>
</body>
</html>

