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

[import_feed] Path/URL bugs in import_feed plugin #389

Open
aigarius opened this issue Jun 27, 2021 · 3 comments
Open

[import_feed] Path/URL bugs in import_feed plugin #389

aigarius opened this issue Jun 27, 2021 · 3 comments
Labels

Comments

@aigarius
Copy link

  1. Redirections are created before the page import happens, so the redirection map is always empty and no redirects are written into the config file

  2. Folder structure of the posts is not re-created, so everything is dumped in the same folder (requiring redirections)

  3. Redirections construct a wrong destination URL if the SITE_URL from the feed contains path elements (the path part gets included twice)

IMHO, when importing a RSS with SITE_URL set to "http://example.com/blog/" and posts like "http://example.com/blog/2011/04/03/testing-this-engine/" the output file should be "posts/2011/04/03/testing-this-engine/indext.html" with no redirect required. With SITE_URL set to "http://example.com/" and BASE_URL set to "http://example.com/blog/"

If slugifying each path element of the target name produces a different outcome, only then a redirect should be created from "2011/04/03/testing-utf-8-in-title-ā/" to "2011/04/03/testing-utf-8-in-title-a/index.html" and file be created as "posts/2011/04/03/testing-utf-8-in-title-a/index.html"

@aigarius aigarius changed the title Bugs in import_feed plugin [import_feed] Path/URL bugs in import_feed plugin Jun 27, 2021
@aigarius
Copy link
Author

For reference I was trying to import this feed

@ralsina
Copy link
Member

ralsina commented Jun 27, 2021

Yeah, that's really buggy :-(

@ralsina ralsina added the bug label Jun 27, 2021
aigarius added a commit to aigarius/plugins that referenced this issue Jun 27, 2021
* Actually consider generated redirects
* Do not squash post sub-folder structure (like date folders)
* Only generate redirects if URLs change
* Support having blog posts in a differently named top folder

Issue: getnikola#389
@aigarius
Copy link
Author

Pushed some code that worked for my case, not 100% sure it will work in all use cases. But given the above feed and specifying "blog" as the new top folder option, I got very reasonable output in both files and URLs (no redirects required).

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

No branches or pull requests

2 participants