default.php 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. <?php
  2. $settingsContent = settings('content')->getAll();
  3. ?>
  4. <!DOCTYPE html>
  5. <html lang="<?= $seo['extra_fields']['locale'] ?? 'en' ?>">
  6. <head>
  7. <meta charset="UTF-8">
  8. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  9. <base href="/">
  10. <title><?= $seo['title'] ?></title>
  11. <link rel="stylesheet" href="css/styles.css">
  12. <meta name='robots' content='index, follow' />
  13. <?php if (!empty($settingsContent['favicon'])): ?>
  14. <link rel="icon" href="<?= htmlspecialchars($settingsContent['favicon']) ?>" type="image/x-icon">
  15. <?php endif; ?>
  16. <meta property="og:title" content="<?= $seo['title'] ?? '' ?>">
  17. <meta property="og:description" content="<?= $seo['description'] ?? '' ?>">
  18. <meta property="og:locale" content="<?= $seo['extra_fields']['locale'] ?? '' ?>">
  19. <meta property="og:image" content="<?= htmlspecialchars($seo['image'] ?? '') ?>">
  20. <meta name="description" content="<?= $seo['description'] ?? '' ?>">
  21. <link rel="canonical" href="<?= $seo['canonical'] ?? '' ?>">
  22. <script type="application/ld+json">
  23. <?php include __DIR__ . '/../partials/schema.php'; ?>
  24. </script>
  25. <?php include __DIR__ . '/../partials/styles.php'; ?>
  26. </head>
  27. <body>
  28. <?php include __DIR__ . '/../partials/header.php'; ?>
  29. <main class="main">
  30. <?php if (!empty($topContent)): ?>
  31. <section class="top-content">
  32. <div class="container">
  33. <?= $topContent ?>
  34. </div>
  35. </section>
  36. <?php endif; ?>
  37. <section class="page-content">
  38. <div class="container">
  39. <h1><?= htmlspecialchars($pageData['name']) ?></h1>
  40. <?php if (!empty($containts)): ?>
  41. <div class="toc">
  42. <h2>Содержание</h2>
  43. <nav class="toc-nav">
  44. <ul>
  45. <?php foreach ($containts as $item): ?>
  46. <li>
  47. <a href="#<?= htmlspecialchars($item['id']) ?>">
  48. <?= htmlspecialchars($item['text']) ?>
  49. </a>
  50. <?php if (!empty($item['h3'])): ?>
  51. <ul>
  52. <?php foreach ($item['h3'] as $subItem): ?>
  53. <li>
  54. <a href="#<?= htmlspecialchars($subItem['id']) ?>">
  55. <?= htmlspecialchars($subItem['text']) ?>
  56. </a>
  57. </li>
  58. <?php endforeach; ?>
  59. </ul>
  60. <?php endif; ?>
  61. </li>
  62. <?php endforeach; ?>
  63. </ul>
  64. </nav>
  65. </div>
  66. <?php endif; ?>
  67. <div class="content">
  68. <?= $pageContent ?>
  69. </div>
  70. </div>
  71. </section>
  72. <?php if (!empty($faqItems)): ?>
  73. <section class="faq-section">
  74. <div class="container">
  75. <h2>FAQ</h2>
  76. <div class="faq-list">
  77. <?php foreach ($faqItems as $faq): ?>
  78. <div class="faq-item">
  79. <h3><?= htmlspecialchars($faq['question']) ?></h3>
  80. <div class="faq-answer">
  81. <?= $faq['answer'] ?>
  82. </div>
  83. </div>
  84. <?php endforeach; ?>
  85. </div>
  86. </section>
  87. <?php endif; ?>
  88. </main>
  89. <?php include __DIR__ . '/../partials/footer.php'; ?>
  90. <script src="js/script.js"></script>
  91. </body>
  92. </html>