Skip to content

Commit

Permalink
v0.14.2: bug fixes for templates w/ virtual pages
Browse files Browse the repository at this point in the history
  • Loading branch information
mDuo13 committed Apr 27, 2021
1 parent 23a5878 commit ad03f7f
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 8 deletions.
2 changes: 1 addition & 1 deletion dactyl/templates/breadcrumbs.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

{% if currentpage.html != "index.html" %}
{%- for page in ns.crumbs %}
<li class="active breadcrumb-item"><a href="{{ target.prefix }}{{ page.html }}">{{ page.name }}</a></li>
<li class="active breadcrumb-item"><a href="{% if "//" not in page.html %}{{ currentpage.prefix }}{% endif %}{{ page.html }}">{{ page.name }}</a></li>
{% endfor %}
{% endif %}
<li class="active breadcrumb-item">{{ currentpage.name }}</li>
Expand Down
2 changes: 1 addition & 1 deletion dactyl/templates/children.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
{% for child in parent.children %}
{% if child.nav_omit is defined and child.nav_omit %}{# skip pages that are omitted from navigation #}
{% elif ns.count_printed < count_limit %}
<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>
<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>
{% set ns.count_printed = ns.count_printed + 1 %}
{% if indent_level+1 <= depth_limit %}
{# recursively print descendants #}
Expand Down
2 changes: 1 addition & 1 deletion dactyl/templates/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
{% for page in pages %}
{% if page.parent is defined and page.parent == "index.html" %}
<li class="nav-item {% if currentpage == page %}active{% elif page.is_ancestor_of(currentpage.html) %}active-parent{% endif %}">
<a class="nav-link" href="{{ target.prefix }}{{ page.html }}">{{ page.name }}</a>
<a class="nav-link" href="{% if "//" not in page.html %}{{ currentpage.prefix }}{% endif %}{{ page.html }}">{{ page.name }}</a>
</li>
{% endif %}
{% endfor %}
Expand Down
2 changes: 1 addition & 1 deletion dactyl/templates/redirect.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
{% block main %}
<article class="pt-3 p-md-3">
<div class="content">
<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>.
<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>.
</div>
</article>
{% endblock %}
6 changes: 3 additions & 3 deletions dactyl/templates/tree-nav.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@

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


<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>
<a class="nav-link" href="{{target.prefix}}{{pg.html}}">{{ pg.name }}</a>
<a class="nav-link" href="{% if "//" not in pg.html %}{{currentpage.prefix}}{% endif %}{{pg.html}}">{{ pg.name }}</a>

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

<nav class="nav flex-column dactyl-tree-nav">
<div class="nav-item nav-parent">
<a class="nav-link" href="{{target.prefix}}{{tree_top.html}}">{{tree_top.name}}</a>
<a class="nav-link" href="{% if "//" not in tree_top.html %}{{currentpage.prefix}}{% endif %}{{tree_top.html}}">{{tree_top.name}}</a>
</div>
{% for child in tree_top.children %}
{{ page_w_children(child, loop.index) }}
Expand Down
2 changes: 1 addition & 1 deletion dactyl/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '0.14.1'
__version__ = '0.14.2'
5 changes: 5 additions & 0 deletions releasenotes.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# v0.14.2 Release Notes

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.)


# v0.14.1 Release Notes

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.)
Expand Down

0 comments on commit ad03f7f

Please sign in to comment.