Mercurial > piecrust2
comparison docs/templates/doc.html @ 353:8140ff806258
docs: Add "active page" style for the navigation menu.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Fri, 17 Apr 2015 16:38:00 -0700 |
parents | f51b69ad09ae |
children | 61d53d2163d6 |
comparison
equal
deleted
inserted
replaced
352:498a917cd2d4 | 353:8140ff806258 |
---|---|
1 {% extends "default.html" %} | 1 {% extends "default.html" %} |
2 | |
3 {% macro pagelink(title, url) -%} | |
4 <a href="{{url}}"{% if url == page.url %} class="active"{% endif %}>{{title}}</a> | |
5 {%- endmacro %} | |
2 | 6 |
3 {% block head %} | 7 {% block head %} |
4 {% if page.needs_pygments %} | 8 {% if page.needs_pygments %} |
5 <style type="text/css"> | 9 <style type="text/css"> |
6 {{highlight_css()}} | 10 {{highlight_css()}} |
21 </section> | 25 </section> |
22 <aside class="col-md-4"> | 26 <aside class="col-md-4"> |
23 <ul class="doc-level1"> | 27 <ul class="doc-level1"> |
24 {% for p in family.root %} | 28 {% for p in family.root %} |
25 {% if p.is_dir and p.is_page %} | 29 {% if p.is_dir and p.is_page %} |
26 <li><a href="{{p.url}}">{{p.title}}</a> | 30 <li>{{ pagelink(p.title, p.url) }} |
27 <ul class="doc-level2"> | 31 <ul class="doc-level2"> |
28 {% for p2 in p.children %} | 32 {% for p2 in p.children %} |
29 <li><a href="{{p2.url}}">{{p2.title}}</a></li> | 33 <li>{{ pagelink(p2.title, p2.url) }}</li> |
30 {% endfor %} | 34 {% endfor %} |
31 </ul> | 35 </ul> |
32 </li> | 36 </li> |
33 {% elif not p.is_dir and p.order %} | 37 {% elif not p.is_dir and p.order %} |
34 <li><a href="{{p.url}}">{{p.title}}</a></li> | 38 <li>{{ pagelink(p.title, p.url) }}</li> |
35 {% endif %} | 39 {% endif %} |
36 {% endfor %} | 40 {% endfor %} |
37 </ul> | 41 </ul> |
38 </aside> | 42 </aside> |
39 </div> | 43 </div> |