| Index: includes/toc.tmpl |
| diff --git a/includes/toc.tmpl b/includes/toc.tmpl |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..a8fee2a70e815ac0a5de68eba19ebf0674e54088 |
| --- /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) %} |
|
Wladimir Palant
2015/04/13 12:00:36
Should be title_tag=None the way I see it, this pa
kzar
2015/04/13 12:49:13
Done.
|
| + {% 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> |
|
Wladimir Palant
2015/04/13 12:00:36
This is a relative link, it won't work correctly i
kzar
2015/04/13 12:49:13
Ouch, Done.
|
| + {% if item.subitems %}{{ toc(item.subitems) }}{% endif %} |
| + </li> |
| + {% endfor %} |
| + </ul> |
| +{% endmacro %} |