| Index: includes/toc.tmpl |
| diff --git a/includes/toc.tmpl b/includes/toc.tmpl |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..8224a150a5c4e5039780649ad796e4fa2239e7c7 |
| --- /dev/null |
| +++ b/includes/toc.tmpl |
| @@ -0,0 +1,33 @@ |
| +{# |
| + # This file is part of the Adblock Plus website, |
| + # Copyright (C) 2006-2015 Eyeo GmbH |
| + # |
| + # Adblock Plus is free software: you can redistribute it and/or modify |
| + # it under the terms of the GNU General Public License version 3 as |
| + # published by the Free Software Foundation. |
| + # |
| + # Adblock Plus is distributed in the hope that it will be useful, |
| + # but WITHOUT ANY WARRANTY; without even the implied warranty of |
| + # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| + # GNU General Public License for more details. |
| + # |
| + # You should have received a copy of the GNU General Public License |
| + # along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. |
| + #} |
| + |
| +{% macro toc(page, title_tag) %} |
| + {% set page_content = get_page_content(page) %} |
| + {% set toclist = page_content["body"]|toclist %} |
| + |
| + {% if title_tag %} |
| + <{{ title_tag }}>{{ page_content["title"] }}</{{ title_tag }}> |
| + {% endif %} |
| + <ul> |
| + {% for item in toclist %} |
| + <li> |
| + <a href="{{ page }}#{{item.anchor}}">{{item.title}}</a> |
|
Sebastian Noack
2015/04/13 09:58:16
Nit: Please add whitespaces after "{{" and before
kzar
2015/04/13 11:20:21
Done.
|
| + {% if item.subitems %}{{toc(item.subitems)}}{% endif %} |
| + </li> |
| + {% endfor %} |
| + </ul> |
| +{% endmacro %} |