Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

current_page.ancestors only contains direct ancestor and not the full path of the page #693

Closed
rickpeters opened this issue Jul 24, 2015 · 3 comments
Labels
Milestone

Comments

@rickpeters
Copy link

@rickpeters rickpeters commented Jul 24, 2015

I'm using the mkdocs theme and tried to enhance it with a breadcrumb trail. The page navigation is created automatically by mkdocs (I don't use the pages confguration since I have almost 300 pages).
I copied and adapted the breadcrumbs.html file from the readthedocs theme and integrated it in content.html:

<ol class="breadcrumb">
<li><a href="{{ homepage_url }}">Docs</a></li>
{% if current_page %}
  {% for doc in current_page.ancestors %}
    {% if doc.link %}
      <li><a href="{{ doc.link|e }}">{{ doc.title }}</a></li>
    {% else %}
      <li>{{ doc.title }}</li>
    {% endif %}
  {% endfor %}
{% endif %}
{% if current_page %}<li>{{ current_page.title }}</li>{% endif %}
</ol>

My file path (starting from the docs_dir) is:
beheerteam/diensten/algemeen/ActiveDirectory.md
The generated breadcrumb trail is:
Docs/algemeen/ActiveDirectory

algemeen is the only part that originates from the loop for doc in current_page.ancestors.

Maybe this is a stupid question or it is just not possible, but I couldn't find i in the documentation and I'm just starting with mkdocs and couldn't understand the source on how this works.

d0ugal added a commit to d0ugal/mkdocs that referenced this issue Jul 25, 2015
@d0ugal d0ugal added the Bug label Jul 25, 2015
@d0ugal d0ugal added this to the 0.15.0 milestone Jul 25, 2015
@d0ugal
Copy link
Member

@d0ugal d0ugal commented Jul 25, 2015

Confirmed the issue, I've got a fix which should resolve it - #694

Loading

d0ugal added a commit to d0ugal/mkdocs that referenced this issue Jul 25, 2015
@d0ugal d0ugal closed this in #694 Jul 25, 2015
@d0ugal d0ugal reopened this Jul 25, 2015
@d0ugal
Copy link
Member

@d0ugal d0ugal commented Jul 25, 2015

re-opening as it sounds like #694 may not have fixed all the things.

Loading

@d0ugal d0ugal mentioned this issue Jan 15, 2016
5 tasks
@d0ugal
Copy link
Member

@d0ugal d0ugal commented Jan 19, 2016

Okay, I've tested this and think it behaves as I expected.

Loading

@d0ugal d0ugal closed this Jan 19, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants