layout--static.html.php 5.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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="docs single" <?php if (isset($is_page)):?>onload="htmlTableOfContents('.page-<?php echo $static->slug;?>');"<?php endif;?> <?php if (isset($is_subpage)):?>onload="htmlTableOfContents('.subpage-<?php echo $static->slug;?>');"<?php endif;?>>
  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. <div class="wrap container" role="document">
  56. <div id="content" class="content">
  57. <div class="row flex-xl-nowrap">
  58. <div class="col-lg-5 col-xl-4 docs-bar">
  59. <input class="menu-btn order-0 float-right" type="checkbox" id="menu-btn2">
  60. <label class="menu-icon float-right" for="menu-btn2"><span class="navicon"></span></label>
  61. <div class="docs-sidebar">
  62. <nav class="docs-links" aria-label="Main navigation">
  63. <?php echo get_menu('list-unstyled collapsible-sidebar', false);?>
  64. </nav>
  65. </div>
  66. </div>
  67. <?php echo content();?>
  68. </div>
  69. </div>
  70. </div>
  71. <footer class="footer text-muted">
  72. <div class="container">
  73. <div class="row">
  74. <div class="col-lg-8 order-last order-lg-first">
  75. <ul class="list-inline">
  76. <li class="list-inline-item"><?php echo copyright();?></li>
  77. </ul>
  78. </div>
  79. <div class="col-lg-8 order-last order-lg-last text-lg-end">
  80. <ul class="list-inline">
  81. <li class="list-inline-item">Design by <a href="https://getdoks.org/" target="_blank" rel="nofollow">Doks</a></li>
  82. </ul>
  83. </div>
  84. </div>
  85. </div>
  86. </footer>
  87. <script src="<?php echo theme_path();?>js/toc.js"></script>
  88. <script src="<?php echo theme_path();?>js/main.js"></script>
  89. <?php if (analytics()): ?><?php echo analytics() ?><?php endif; ?>
  90. </body>
  91. </html>