main website improvements
This commit is contained in:
parent
99c08e03c0
commit
0803c5f2a4
4 changed files with 27 additions and 2 deletions
|
@ -122,3 +122,8 @@ header {
|
|||
margin-right: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
.toc {
|
||||
background-color: #f0f0f0;
|
||||
padding: 8px;
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
</span>
|
||||
<br />
|
||||
<small>
|
||||
Posted {% if post.extra.author %}by {{ post.extra.author }}{% endif %}
|
||||
{{ post.reading_time }} min - Posted {% if post.extra.author %}by {{ post.extra.author }}{% endif %}
|
||||
on {{ post.date }}
|
||||
</small>
|
||||
</td>
|
||||
|
|
12
templates/macros/post.html
Normal file
12
templates/macros/post.html
Normal file
|
@ -0,0 +1,12 @@
|
|||
{% macro render_toc(toc) %}
|
||||
<ul>
|
||||
{% for item in toc %}
|
||||
<li>
|
||||
<a href="{{ item.permalink | safe }}">{{ item.title }}</a>
|
||||
{% if item.children %}
|
||||
{{ self::render_toc(toc=item.children) }}
|
||||
{% endif %}
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endmacro %}
|
|
@ -1,4 +1,5 @@
|
|||
{% extends "layout.html" %}
|
||||
{% import "macros/post.html" as post %}
|
||||
|
||||
{% block title %}
|
||||
{% if page.title %}{{ page.title }} - {% endif %}
|
||||
|
@ -14,6 +15,13 @@
|
|||
on {{ page.date }}
|
||||
</small>
|
||||
{% endif %}
|
||||
|
||||
{% if page.toc.children | length %}
|
||||
<div class="toc">
|
||||
{{ post::render_toc(toc=page.toc) }}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{{ page.content | safe }}
|
||||
{% if page.extra.link %}
|
||||
<p>Visit <a href="{{ page.extra.link }}">here</a> for more info.</p>
|
||||
|
|
Loading…
Reference in a new issue