editor.html 1.5 KB

123456789101112131415161718192021222324252627282930313233343536
  1. {% extends "base.html" %}
  2. {% block title %}编辑文章 - 个人博客{% endblock %}
  3. {% block extra_head %}
  4. <style>
  5. .editor-container { max-width: 800px; margin: 0 auto; }
  6. .editor-title { width: 100%; padding: 0.5rem; font-size: 1.5rem; margin-bottom: 1rem; }
  7. .editor-toolbar { margin-bottom: 1rem; display: flex; gap: 1rem; align-items: center; }
  8. .editor-textarea { width: 100%; min-height: 400px; padding: 1rem; font-family: monospace; font-size: 1rem; resize: vertical; }
  9. </style>
  10. {% endblock %}
  11. {% block content %}
  12. <div class="editor-container">
  13. <h1>创建新文章</h1>
  14. <form method="POST" id="editorForm">
  15. <div class="form-group">
  16. <input type="text" name="title" class="editor-title" placeholder="文章标题" required>
  17. </div>
  18. <div class="editor-toolbar">
  19. <button type="button" id="uploadImageBtn" class="btn">📷 插入图片</button>
  20. <input type="file" id="imageFileInput" accept="image/*" style="display:none">
  21. </div>
  22. <div class="form-group">
  23. <textarea name="content" id="markdownContent" class="editor-textarea" placeholder="在此书写 Markdown 内容..." required></textarea>
  24. </div>
  25. <button type="submit" class="btn btn-primary">💾 发布文章</button>
  26. </form>
  27. <div id="uploadStatus" style="margin-top:0.5rem;"></div>
  28. </div>
  29. {% endblock %}
  30. {% block extra_scripts %}
  31. <script src="{{ url_for('static', filename='js/editor.js') }}"></script>
  32. {% endblock %}