layout.html.php 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. <?php if (!defined('HTMLY')) die('HTMLy'); ?>
  2. <!DOCTYPE html>
  3. <html lang="<?php echo blog_language();?>">
  4. <head>
  5. <?php echo head_contents();?>
  6. <?php echo $metatags;?>
  7. <link rel="preload" as="font" href="<?php echo theme_path();?>fonts/jost/jost-v4-latin-regular.woff2" type="font/woff2" crossorigin>
  8. <link rel="preload" as="font" href="<?php echo theme_path();?>fonts/jost/jost-v4-latin-700.woff2" type="font/woff2" crossorigin>
  9. <link rel="stylesheet" href="<?php echo theme_path();?>css/style.css">
  10. <meta name="theme-color" content="#fff">
  11. </head>
  12. <body class="blog list">
  13. <div class="header-bar fixed-top"></div>
  14. <?php if (facebook()) { echo facebook(); } ?>
  15. <?php if (login()) { toolbar(); } ?>
  16. <?php if (login()):?>
  17. <script>
  18. function updateContentPosition() {
  19. const toolbarHeight = document.querySelector("#toolbar").offsetHeight; // Calculate #toolbar height
  20. const contentDiv = document.querySelector("#content");
  21. contentDiv.style.paddingTop = `${toolbarHeight}px`;
  22. }
  23. // Run once when the page loads
  24. window.addEventListener("DOMContentLoaded", updateContentPosition);
  25. // Update on window resize
  26. window.addEventListener("resize", updateContentPosition);
  27. </script>
  28. <?php endif;?>
  29. <header class="navbar fixed-top navbar-expand-md navbar-light">
  30. <?php $filename = "content/data/menu.json";
  31. if (file_exists($filename)) {
  32. $json = json_decode(file_get_contents('content/data/menu.json', true));
  33. $menus = json_decode($json);
  34. } ?>
  35. <div class="container">
  36. <input class="menu-btn order-0" type="checkbox" id="menu-btn">
  37. <?php if (!empty($menus)):?>
  38. <label class="menu-icon d-md-none" for="menu-btn"><span class="navicon"></span></label>
  39. <?php endif;?>
  40. <a class="navbar-brand order-1 order-md-0 me-auto" href="<?php echo site_url();?>">
  41. <?php echo blog_title();?>
  42. </a>
  43. <button id="mode" class="btn btn-link order-2 order-md-4" type="button" aria-label="Toggle mode">
  44. <span class="toggle-dark"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-moon"><path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"></path></svg></span>
  45. <span class="toggle-light"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-sun"><circle cx="12" cy="12" r="5"></circle><line x1="12" y1="1" x2="12" y2="3"></line><line x1="12" y1="21" x2="12" y2="23"></line><line x1="4.22" y1="4.22" x2="5.64" y2="5.64"></line><line x1="18.36" y1="18.36" x2="19.78" y2="19.78"></line><line x1="1" y1="12" x2="3" y2="12"></line><line x1="21" y1="12" x2="23" y2="12"></line><line x1="4.22" y1="19.78" x2="5.64" y2="18.36"></line><line x1="18.36" y1="5.64" x2="19.78" y2="4.22"></line></svg></span>
  46. </button>
  47. <nav class="navbar-nav social-nav order-3 order-md-5">
  48. <?php echo social();?>
  49. </nav>
  50. <div class="collapse navbar-collapse order-4 order-md-1 top-menu">
  51. <?php if (!empty($menus)) { echo menu();}?>
  52. </div>
  53. </div>
  54. </header>
  55. <?php if(config('static.frontpage') == 'true' && isset($is_front)) {
  56. $pages = find_page();
  57. $front = get_frontpage(); ?>
  58. <div class="wrap container" role="document">
  59. <div class="content">
  60. <section class="section container-fluid mt-n3 pb-3">
  61. <div class="row justify-content-center">
  62. <div class="col-lg-12 text-center">
  63. <h1 class="mt-0"><?php echo $front->title;?></h1>
  64. <?php if(login()):?><small><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentcolor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-edit-2"><path d="M17 3a2.828 2.828.0 114 4L7.5 20.5 2 22l1.5-5.5L17 3z"></path></svg> <a href="<?php echo $front->url;?>/edit?destination=front"><?php echo i18n('edit');?></a></small><?php endif;?>
  65. </div>
  66. <div class="col-lg-9 col-xl-8 text-center">
  67. <div class="lead"><?php echo $front->body;?></div>
  68. <?php if (!empty($pages[0])):?><a class="btn btn-primary btn-lg px-4 mb-2" href="<?php echo $pages[0]->url;?>" role="button">Get Started</a><?php endif;?>
  69. </div>
  70. </div>
  71. </section>
  72. </div>
  73. </div>
  74. <div class="d-flex justify-content-start"><div class="bg-dots"></div></div>
  75. <section class="section section-sm">
  76. <div class="container">
  77. <div class="row justify-content-center text-center">
  78. <?php foreach ($pages as $pg):?>
  79. <div class="col-lg-5">
  80. <h2 class="h4"><a href="<?php echo $pg->url;?>"><?php echo $pg->title;?></a></h2>
  81. <p><?php echo $pg->description;?></p>
  82. </div>
  83. <?php endforeach;?>
  84. </div>
  85. </div>
  86. </section>
  87. <?php } else {?>
  88. <div class="wrap container" role="document">
  89. <div id="content" class="content">
  90. <div class="row justify-content-center">
  91. <div class="col-md-12 col-lg-10 col-xl-9">
  92. <?php echo content();?>
  93. </div>
  94. </div>
  95. </div>
  96. </div>
  97. <?php }?>
  98. <section class="section section-sm container-fluid"><div class="row justify-content-center text-center"><div class="col-lg-9"></div></div></section>
  99. <footer class="footer text-muted">
  100. <div class="container">
  101. <div class="row">
  102. <div class="col-lg-8 order-last order-lg-first">
  103. <ul class="list-inline">
  104. <li class="list-inline-item"><?php echo copyright();?></li>
  105. </ul>
  106. </div>
  107. <div class="col-lg-8 order-last order-lg-last text-lg-end">
  108. <ul class="list-inline">
  109. <li class="list-inline-item">Design by <a href="https://getdoks.org/" target="_blank" rel="nofollow">Doks</a></li>
  110. </ul>
  111. </div>
  112. </div>
  113. </div>
  114. </footer>
  115. <script src="<?php echo theme_path();?>js/main.js"></script>
  116. <?php if (analytics()): ?><?php echo analytics() ?><?php endif; ?>
  117. </body>
  118. </html>