Skip to content

Commit ad03f7f

Browse files
committed
v0.14.2: bug fixes for templates w/ virtual pages
1 parent 23a5878 commit ad03f7f

7 files changed

+13
-8
lines changed

dactyl/templates/breadcrumbs.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
{% if currentpage.html != "index.html" %}
1717
{%- for page in ns.crumbs %}
18-
<li class="active breadcrumb-item"><a href="{{ target.prefix }}{{ page.html }}">{{ page.name }}</a></li>
18+
<li class="active breadcrumb-item"><a href="{% if "//" not in page.html %}{{ currentpage.prefix }}{% endif %}{{ page.html }}">{{ page.name }}</a></li>
1919
{% endfor %}
2020
{% endif %}
2121
<li class="active breadcrumb-item">{{ currentpage.name }}</li>

dactyl/templates/children.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
{% for child in parent.children %}
2323
{% if child.nav_omit is defined and child.nav_omit %}{# skip pages that are omitted from navigation #}
2424
{% elif ns.count_printed < count_limit %}
25-
<li class="level-{{indent_level}}"><a href="{{target.prefix}}{{child.html}}">{{child.name}}</a>{% if show_blurbs and child.blurb is defined %}<p class="blurb child-blurb">{{child.blurb}}</p>{% endif %}</li>
25+
<li class="level-{{indent_level}}"><a href="{% if "//" not in child.html %}{{currentpage.prefix}}{% endif %}{{child.html}}">{{child.name}}</a>{% if show_blurbs and child.blurb is defined %}<p class="blurb child-blurb">{{child.blurb}}</p>{% endif %}</li>
2626
{% set ns.count_printed = ns.count_printed + 1 %}
2727
{% if indent_level+1 <= depth_limit %}
2828
{# recursively print descendants #}

dactyl/templates/header.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
{% for page in pages %}
1010
{% if page.parent is defined and page.parent == "index.html" %}
1111
<li class="nav-item {% if currentpage == page %}active{% elif page.is_ancestor_of(currentpage.html) %}active-parent{% endif %}">
12-
<a class="nav-link" href="{{ target.prefix }}{{ page.html }}">{{ page.name }}</a>
12+
<a class="nav-link" href="{% if "//" not in page.html %}{{ currentpage.prefix }}{% endif %}{{ page.html }}">{{ page.name }}</a>
1313
</li>
1414
{% endif %}
1515
{% endfor %}

dactyl/templates/redirect.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
{% block main %}
99
<article class="pt-3 p-md-3">
1010
<div class="content">
11-
<p>This page has been moved! You should be redirected automatically. If not, <a href="{{target.prefix}}{{currentpage.redirect_url}}">click here to go to the new {{currentpage.name}} page</a>.
11+
<p>This page has been moved! You should be redirected automatically. If not, <a href="{% if "//" not in currentpage.redirect_url %}{{target.prefix}}{% endif %}{{currentpage.redirect_url}}">click here to go to the new {{currentpage.name}} page</a>.
1212
</div>
1313
</article>
1414
{% endblock %}

dactyl/templates/tree-nav.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@
1111

1212
<div class="nav-item {% if currentpage == pg %}active{% elif active_parent%}active-parent{% endif %}">
1313
{% if not pg.children %}
14-
<a class="nav-link nav-leaf" href="{{target.prefix}}{{pg.html}}">{{ pg.name }}</a>
14+
<a class="nav-link nav-leaf" href="{% if "//" not in pg.html %}{{currentpage.prefix}}{% endif %}{{pg.html}}">{{ pg.name }}</a>
1515
{% else %}
1616

1717

1818
<a class="nav-toggler {% if not active_parent and currentpage != pg %}collapsed{% endif %}" role="button" data-toggle="collapse" href="#tree_nav_group_{{n}}" aria-expanded="{% if active_parent or currentpage == pg %}true{% else %}false{% endif %}" aria-controls="tree_nav_group_{{n}}"></a>
19-
<a class="nav-link" href="{{target.prefix}}{{pg.html}}">{{ pg.name }}</a>
19+
<a class="nav-link" href="{% if "//" not in pg.html %}{{currentpage.prefix}}{% endif %}{{pg.html}}">{{ pg.name }}</a>
2020

2121
<nav class="nav flex-column {% if active_parent or pg == currentpage %}show {% else %}collapse{% endif %}" id="tree_nav_group_{{n}}">
2222
{% for child in pg.children %}
@@ -30,7 +30,7 @@
3030

3131
<nav class="nav flex-column dactyl-tree-nav">
3232
<div class="nav-item nav-parent">
33-
<a class="nav-link" href="{{target.prefix}}{{tree_top.html}}">{{tree_top.name}}</a>
33+
<a class="nav-link" href="{% if "//" not in tree_top.html %}{{currentpage.prefix}}{% endif %}{{tree_top.html}}">{{tree_top.name}}</a>
3434
</div>
3535
{% for child in tree_top.children %}
3636
{{ page_w_children(child, loop.index) }}

dactyl/version.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = '0.14.1'
1+
__version__ = '0.14.2'

releasenotes.md

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# v0.14.2 Release Notes
2+
3+
This release fixes a couple bugs in the built-in templates when using virtual pages with a `prefix` value. It also changes to use the `prefix` value inherited at the page level so that individual pages can overwrite the value if necessary. (A 404 page, for example, might want to use a separate prefix since it may be used at different paths.)
4+
5+
16
# v0.14.1 Release Notes
27

38
This release removes a couple of debug statements that broke compatibility with Python 3.5. (Python 3.5 has reached end of life, but Dactyl still works with it for now if you use the right versions of its dependencies.)

0 commit comments

Comments
 (0)