html的标签规范

if/else标签
{ % if condition1 %}
... display 1
{ % elif conditon2 %}
... display 2
{ % else % }
... display 3
{% endif %}

for标签
<ul>
{% for athlete in athlete_list %}
<li>{{ athlete.name }}</li>
{% endfor %}
</ul>

ifequal/ifnotequal标签
{% ifequal user currentuser %}
<h1>Welcome!</h1>
{% endifequal %}

{% ifequal section 'sitenews' %}
<h1>Site News</h1>
{% else %}
<h1>No News Here</h1>
{% endifequal %}

注释标签
{# 这是一个注释 #}

posted @ 2019-05-27 13:48 子鱼珠帘 阅读(...) 评论(...) 编辑 收藏