Skip to content

Commit fadd4d4

Browse files
author
yangxg
committed
详情页增加目录,评论区增加 id 定位锚点
1 parent d4343c3 commit fadd4d4

File tree

2 files changed

+26
-2
lines changed

2 files changed

+26
-2
lines changed

templates/base.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ <h1><a href="index.html"><b>Black</b> &amp; White</a></h1>
7171
{% endblock main %}
7272
</main>
7373
<aside class="col-md-4">
74+
{% block toc %}
75+
{% endblock toc %}
7476
<div class="widget widget-recent-posts">
7577
<h3 class="widget-title">最新文章</h3>
7678
<ul>

templates/blog/detail.html

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ <h1 class="entry-title">{{ post.title }}</h1>
1717
{{ post.body }}
1818
</div>
1919
</article>
20-
<section class="comment-area">
20+
<section class="comment-area" id="comment-area">
2121
<hr>
2222
<h3>发表评论</h3>
2323
<form action="#" method="post" class="comment-form">
@@ -75,4 +75,26 @@ <h3>评论列表,共 <span>4</span> 条评论</h3>
7575
</ul>
7676
</div>
7777
</section>
78-
{% endblock main %}
78+
{% endblock main %}
79+
{% block toc %}
80+
<div class="widget widget-content">
81+
<h3 class="widget-title">文章目录</h3>
82+
<ul>
83+
<li>
84+
<a href="#">教程特点</a>
85+
</li>
86+
<li>
87+
<a href="#">谁适合这个教程</a>
88+
</li>
89+
<li>
90+
<a href="#">在线预览</a>
91+
</li>
92+
<li>
93+
<a href="#">资源列表</a>
94+
</li>
95+
<li>
96+
<a href="#">获取帮助</a>
97+
</li>
98+
</ul>
99+
</div>
100+
{% endblock toc %}

0 commit comments

Comments
 (0)