Skip to content

Commit 8062ad0

Browse files
author
yangxg
committed
添加目录
1 parent ef74e8b commit 8062ad0

File tree

2 files changed

+27
-2
lines changed

2 files changed

+27
-2
lines changed

templates/base.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ <h1><a href="{% url 'blog:index' %}"><b>Black</b> &amp; White</a></h1>
7373
{% endblock main %}
7474
</main>
7575
<aside class="col-md-4">
76+
{% block toc %}
77+
{% endblock toc %}
7678
<div class="widget widget-recent-posts">
7779
<h3 class="widget-title">最新文章</h3>
7880
{% get_recent_posts as recent_post_list %}

templates/blog/detail.html

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ <h3>评论列表,共 <span>{{ post.comment_set.count }}</span> 条评论</h3>
5454
{% for comment in comment_list %}
5555
<li class="comment-item">
5656
<span class="nickname">{{ comment.name }}</span>
57-
<time class="submit-date">{{ comment.created_time }}</time>
57+
<time class="submit-date"
58+
datetime="{{ comment.created_time }}">{{ comment.created_time }}</time>
5859
<div class="text">
5960
{{ comment.text }}
6061
</div>
@@ -65,4 +66,26 @@ <h3>评论列表,共 <span>{{ post.comment_set.count }}</span> 条评论</h3>
6566
</ul>
6667
</div>
6768
</section>
68-
{% endblock main %}
69+
{% endblock main %}
70+
{% block toc %}
71+
<div class="widget widget-content">
72+
<h3 class="widget-title">文章目录</h3>
73+
<ul>
74+
<li>
75+
<a href="#">教程特点</a>
76+
</li>
77+
<li>
78+
<a href="#">谁适合这个教程</a>
79+
</li>
80+
<li>
81+
<a href="#">在线预览</a>
82+
</li>
83+
<li>
84+
<a href="#">资源列表</a>
85+
</li>
86+
<li>
87+
<a href="#">获取帮助</a>
88+
</li>
89+
</ul>
90+
</div>
91+
{% endblock toc %}

0 commit comments

Comments
 (0)