base.html 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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') }}" class="add-post-btn">+ 增加文章</a></li>
  29. <li><a href="{{ url_for('admin') }}">管理</a></li>
  30. </ul>
  31. </div>
  32. </nav>
  33. <main class="main-content">
  34. <div class="post-container">
  35. {% block content %}{% endblock %}
  36. </div>
  37. </main>
  38. <footer class="footer">
  39. <p>&copy; 2026 个人博客系统</p>
  40. </footer>
  41. <script src="{{ url_for('static', filename='js/main.js') }}"></script>
  42. {% block extra_scripts %}{% endblock %}
  43. </body>
  44. </html>