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

$source returning everything in URI, not just matched part #2

Open
liborjelinek opened this issue Nov 3, 2023 · 2 comments
Open

$source returning everything in URI, not just matched part #2

liborjelinek opened this issue Nov 3, 2023 · 2 comments

Comments

@liborjelinek
Copy link
Collaborator

liborjelinek commented Nov 3, 2023

(Migrated from https://gitlab.com/documatt/sphinx-reredirects/-/issues/1. Issue created 3 years ago by ghost-83877-968325 @melaniewalsh.)

$source is returning everything in URI, not just the matched part.

In my config file, I have set my redirects as follows:

"features/*": "https://melaniewalsh.github.io/Intro-Cultural-Analytics/$source.html"

But then the HTML redirects are getting written as:

https://melaniewalsh.github.io/Intro-Cultural-Analytics/features/Command-Line/The-Command-Line.html

If I'm understanding things correctly, this should instead be (without /features):

https://melaniewalsh.github.io/Intro-Cultural-Analytics/Command-Line/The-Command-Line.html
@eecavanna
Copy link

I ran into this issue today.

I think this example in the docs is inaccurate:

image

@eecavanna
Copy link

The plugin uses fnmatch to check whether a given path matches the pattern containing the wildcard.

from fnmatch import fnmatch

# wildcarded source, expand to docnames
expanded_docs = [
doc for doc in self.app.env.found_docs if fnmatch(doc, source)
]

Based on what I see in the fnmatch docs, I don't think fnmatch provides a way to get the portion of the path that matched the wildcard.

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

2 participants