{% extends "./base.html" %}
{% load comment_block %}
{% block title %} {{ post.title }} {% endblock %}

{% block extra_head %}
<link rel="stylesheet" href="/static/highlight/styles/agate.css">
<script src="/static/highlight/highlight.pack.js"></script>
<script>hljs.initHighlightingOnLoad();</script>

{% endblock %}

{% block main %}
    {% if post %}
        <h1>{{ post.title }}</h1>
        <div>
            <span>分类：{{ post.category.name }}</span>
            <span>作者：{{ post.owner.username }}</span>
            <span>访问量：{{ post.pv }}</span>
        </div>
        <p>
            {% autoescape off %}
            {{ post.content_html }}
            {% endautoescape %}
        </p>

    {% else %}
        <h2>没有id为{{ post.id }}的文章</h2>
    {% endif %}

    {% comment_block request.path %}

{% endblock %}