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

Link traversal toward the root does not appear to work #66

Open
hartmans opened this issue Oct 29, 2023 · 0 comments
Open

Link traversal toward the root does not appear to work #66

hartmans opened this issue Oct 29, 2023 · 0 comments

Comments

@hartmans
Copy link

Using 2.4-1 from Debian, I find the following in the markdown feature documentation:

Relative links are resolved relative to the location of the current page first,
and failing that relative to its parent directory, and so on until the root of

So, if I have a page blog/2020/Hermes.md that links to blogpost98-Yule-Return-of-the-Sun, I would expect it to eventually find that blog/2020/Yule-Return-of-the-Sun.md declares the alias aliases: blogpost98-Yule-Return-of-the-Sun and find that aliased page in the root of the site.
(I'm converting one of my blogs from tikiwiki to staticsite)
I was expecting a bug in the alias logic, so I tried to debug, starting at site.py:resolve_path.

  • That calls root.lookup_page, with root markdown:blog/2020/Hermes.md
  • That calls self.search_root_node.llookup_page (search_root_node being 2020)
  • That looks in self.sub which isn't a match
  • Then self.build_pages which also isn't a match
  • Then by_src_relpath, which also isn't a match
  • And then unwinds to eventually raise a page not found error
    I didn't see any recursion in that path, either for aliases or for normal nodes.
    Can I get a hint as to how this is expected to work so I can do a better job trying to debug?
    (This is not critical at all; this is a new code base for me and I'm trying to be helpful and hopefully suggest a fix, but I have not tracked through all the layers).

For my specific use case I think I can through in a regexp replace as I go from tikiwiki to markdown and solve my specific problem, but I'd like to understand how this ought to work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant