base.html 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <!DOCTYPE html>
  2. <html lang="zh-CN">
  3. <head>
  4. <meta charset="UTF-8" />
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  6. <title>{% block title %}个人博客{% endblock %}</title>
  7. <link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}" />
  8. {% block extra_head %}{% endblock %}
  9. <!-- MathJax 配置 -->
  10. <script>
  11. MathJax = {
  12. tex: {
  13. inlineMath: [['$', '$'], ['\\(', '\\)']]
  14. },
  15. svg: {
  16. fontCache: 'global'
  17. }
  18. };
  19. </script>
  20. <script src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml.js" id="MathJax-script" async></script>
  21. </head>
  22. <body>
  23. <nav class="navbar">
  24. <div class="nav-container">
  25. <a href="{{ url_for('index') }}" class="nav-brand">博客</a>
  26. <ul class="nav-links">
  27. <li><a href="{{ url_for('index') }}">首页</a></li>
  28. <li><a href="{{ url_for('upload') }}">上传</a></li>
  29. <li><a href="{{ url_for('admin') }}">管理</a></li>
  30. </ul>
  31. </div>
  32. </nav>
  33. <main class="main-content">
  34. {% block content %}{% endblock %}
  35. </main>
  36. <footer class="footer">
  37. <p>&copy; {{ now.year if now else 2026 }} 个人博客系统</p>
  38. </footer>
  39. <script src="{{ url_for('static', filename='js/main.js') }}"></script>
  40. {% block extra_scripts %}{% endblock %}
  41. </body>
  42. </html>