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

match_path is not OS agnostic #321

Closed
mvelikikh opened this issue Sep 4, 2024 · 1 comment · Fixed by #323
Closed

match_path is not OS agnostic #321

mvelikikh opened this issue Sep 4, 2024 · 1 comment · Fixed by #323
Labels
bug Something isn't working

Comments

@mvelikikh
Copy link
Contributor

I used the following match_path and found that it resulted in an empty feed (no posts, just an RSS channel element) on Windows.

rss:
  match_path: blog/posts/.*

At the same time, it was working properly on Linux.
The same issue was reported in #264 where it was found that it was working properly in Docker.

The real issue here is that the plugin uses src_path for pattern matching:
https://github.com/Guts/mkdocs-rss-plugin/blob/main/mkdocs_rss_plugin/plugin.py#L278
which results in '\'-URLs on Windows, e.g. blog\posts\something.md.
MkDocs has already dealt with this issue by introducing src_uri: mkdocs/mkdocs#2930
See also:

I have tested that this solution works.
Raising this issue to get the fix done in the plugin.

@Guts
Copy link
Owner

Guts commented Sep 5, 2024

Hello @mvelikikh

Thanks for taking time to report and diagnose. Do you feel like doing the appropriate Pull Request to fix this?

@Guts Guts added the bug Something isn't working label Sep 5, 2024
Guts added a commit that referenced this issue Sep 5, 2024
`page.file.src_path` on Windows contains backslashes resulting in an
empty RSS feed if `match_path` contains a forward slash. This commit
replaces `src_path` with `src_uri` which provides an OS independent path
with forward slashes '/'.

fixes #321
@Guts Guts closed this as completed in #323 Sep 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants