main.php 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. <!DOCTYPE html>
  2. <html lang="<?= $isHomepage ? ($seo['lang'] ?? 'en') : ($seo['lang-page'] ?? 'en-US') ?>">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <base href="/">
  7. <title><?= $content['title'] ?></title>
  8. <link rel="stylesheet" href="css/styles.css">
  9. <meta name='robots' content='index, follow' />
  10. <?php if (!empty($content['favicon'])): ?>
  11. <link rel="icon" href="<?= htmlspecialchars($content['favicon']) ?>" type="image/x-icon">
  12. <?php endif; ?>
  13. <meta property="og:type" content="<?= $seo['og-type'] ?? '' ?>">
  14. <meta property="og:title" content="<?= $seo['og-title'] ?? '' ?>">
  15. <meta property="og:description" content="<?= $seo['og-description'] ?? '' ?>">
  16. <meta property="og:locale" content="<?= $seo['og-locale'] ?? '' ?>">
  17. <meta property="og:image" content="<?= htmlspecialchars($seo['og-image'] ?? '') ?>">
  18. <meta name="description" content="<?= $seo['description'] ?? '' ?>">
  19. <link rel="canonical" href="<?= $seo['canonical'] ?? '' ?>">
  20. <script type="application/ld+json">
  21. <?= json_encode([
  22. "@context" => "https://schema.org",
  23. "@graph" => [
  24. [
  25. "@type" => "WebPage",
  26. "name" => $content['title'],
  27. "description" => $content['description'],
  28. "inLanguage" => $content['lang'],
  29. "url" => $currentUrl,
  30. "dateModified" => $content['modified-date'] ?? '' , // ISO формат
  31. "author" => [
  32. "@type" => "Person",
  33. "name" => $content['author-name'] ?? '',
  34. "image" => $currentDomain . '/' . htmlspecialchars($content['author-img'] ?? '')
  35. ]
  36. ],
  37. [
  38. "@type" => "Organization",
  39. "name" => $domainName,
  40. "url" => $currentDomain,
  41. "logo" => $currentDomain . '/' . htmlspecialchars($content['uploaded_image'] ?? '')
  42. ],
  43. [
  44. "@type" => "BreadcrumbList",
  45. "itemListElement" => [
  46. [
  47. "@type" => "ListItem",
  48. "position" => 1,
  49. "name" => $content['title-h1'],
  50. "item" => $currentUrl
  51. ]
  52. ]
  53. ],
  54. !empty($casinoItems) ? [
  55. "@type" => "ItemList",
  56. "name" => htmlspecialchars($content['listing']),
  57. "itemListElement" => array_map(function ($item, $index) use ($currentDomain, $currentReviewCount) {
  58. return [
  59. "@type" => "ListItem",
  60. "position" => $index + 1,
  61. "item" => [
  62. "@type" => "Offer",
  63. "name" => htmlspecialchars($item['heading']),
  64. "description" => htmlspecialchars($item['text']),
  65. "url" => $currentDomain . '/#' . getSlug($item['heading']),
  66. "offeredBy" => [
  67. "@type" => "Organization",
  68. "name" => htmlspecialchars($item['heading']),
  69. "logo" => $currentDomain . '/' . htmlspecialchars($item['image']),
  70. "aggregateRating" => [
  71. "@type" => "AggregateRating",
  72. "ratingValue" => "5",
  73. "reviewCount" => $currentReviewCount + ($index + 1),
  74. "bestRating" => "5",
  75. "worstRating" => "1"
  76. ]
  77. ]
  78. ]
  79. ];
  80. }, $casinoItems, array_keys($casinoItems))
  81. ] : null,
  82. [
  83. "@type" => "FAQPage",
  84. "mainEntity" => array_map(function ($item) {
  85. return [
  86. "@type" => "Question",
  87. "name" => htmlspecialchars($item['question']),
  88. "acceptedAnswer" => [
  89. "@type" => "Answer",
  90. "text" => htmlspecialchars($item['answer'])
  91. ]
  92. ];
  93. }, $faqItems)
  94. ]
  95. ]
  96. ], JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT); ?>
  97. </script>
  98. <?php include __DIR__ . '/partials/styles.php'; ?>
  99. </head>
  100. <body class="main-color font-color main-font">
  101. <?php include __DIR__ . '/partials/header.php'; ?>
  102. <main class="main">
  103. <?= $pageContent ?>
  104. </main>
  105. <?php include __DIR__ . '/partials/footer.php'; ?>
  106. <script src="js/script.js"></script>
  107. <script src="https://cdnjs.cloudflare.com/ajax/libs/blazy/1.8.2/blazy.min.js"></script>
  108. </body>
  109. </html>