post_template.html 923 B

12345678910111213141516171819202122232425
  1. {% extends "base.html" %}
  2. {% block title %}{{ title }} - 个人博客{% endblock %}
  3. {% block content %}
  4. <article class="card">
  5. {% if thumbnail %}
  6. <div class="card-image">
  7. <img src="{{ thumbnail }}" alt="{{ title }}" />
  8. </div>
  9. {% endif %}
  10. <div class="card-body">
  11. <h1 class="card-title">{{ title }}</h1>
  12. <time class="card-date" datetime="{{ date }}">{{ date[:16] | replace('T', ' ') }}</time>
  13. <div class="card-summary">
  14. {{ content | safe }}
  15. </div>
  16. {% if logged_in and post_id %}
  17. <form method="POST" action="{{ url_for('delete_post', post_id=post_id) }}" onsubmit="return confirm('确定要删除「{{ title }}」吗?此操作不可恢复。');" style="margin-top:1.5rem;">
  18. <button type="submit" class="btn btn-danger">🗑️ 删除文章</button>
  19. </form>
  20. {% endif %}
  21. </div>
  22. </article>
  23. {% endblock %}