base.html 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <!DOCTYPE html>
  2. <html lang="{{ lang }}" data-base-path="{{ site.base_path }}">
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1">
  6. <title>{{ page.title }} - {{ site.title }}</title>
  7. <link rel="icon" type="image/svg+xml" href="{{ site.base_path }}/favicon.svg">
  8. <link rel="stylesheet" href="{{ site.base_path }}/css/main.css">
  9. <script>
  10. (function() {
  11. var t = localStorage.getItem('preferred-theme');
  12. if (!t) t = window.matchMedia('(prefers-color-scheme: light)').matches ? 'light' : 'dark';
  13. if (t === 'light') document.documentElement.setAttribute('data-theme', 'light');
  14. })();
  15. </script>
  16. </head>
  17. <body>
  18. <header class="header">
  19. <div class="header-inner">
  20. <a href="{{ site.base_path }}/{{ lang }}/" class="header-title">{{ site.title }}{% if site.version %} <span style="font-size:0.75em;font-weight:normal;margin-left:4px">v{{ site.version }}</span>{% endif %}</a>
  21. <div class="header-spacer"></div>
  22. <nav class="header-nav">
  23. <a href="{{ site.base_path }}/{{ lang }}/">
  24. <svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"/><polyline points="9 22 9 12 15 12 15 22"/></svg>
  25. Home
  26. </a>
  27. {% for link in site.nav %}
  28. {% if link.url %}
  29. <a href="{{ link.url }}"{% if link.icon_svg %} aria-label="{{ link.label }}"{% endif %}>
  30. {% if link.icon_svg %}{{ link.icon_svg | safe }}{% endif %}
  31. {{ link.label }}
  32. </a>
  33. {% elif link.path %}
  34. <a href="{{ site.base_path }}/{{ lang }}/{{ link.path }}">
  35. {% if link.icon_svg %}{{ link.icon_svg | safe }}{% endif %}
  36. {{ link.label }}
  37. </a>
  38. {% endif %}
  39. {% endfor %}
  40. </nav>
  41. <div class="header-tools">
  42. <button class="theme-toggle" aria-label="Toggle theme"></button>
  43. <div class="lang-selector">
  44. <button class="lang-btn" aria-label="Language">
  45. <svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><line x1="2" y1="12" x2="22" y2="12"/><path d="M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"/></svg>
  46. {{ lang | upper }}
  47. </button>
  48. <ul class="lang-popup">
  49. {% for l in site.langs %}
  50. <li><a href="#" data-lang="{{ l }}">{{ l | upper }}</a></li>
  51. {% endfor %}
  52. </ul>
  53. </div>
  54. </div>
  55. {% block sidebar_toggle %}{% endblock %}
  56. </div>
  57. </header>
  58. {% if page.status == "draft" %}
  59. <div class="draft-banner">DRAFT</div>
  60. {% endif %}
  61. <div class="layout {% block layout_class %}{% endblock %}">
  62. {% block body %}{% endblock %}
  63. </div>
  64. <footer class="footer">
  65. &copy; 2026 yhirose. All rights reserved.
  66. </footer>
  67. <script src="{{ site.base_path }}/js/main.js"></script>
  68. </body>
  69. </html>