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

Fix #3022 -- Explain index.html conflicts better #3026

Merged
merged 3 commits into from Apr 15, 2018

Conversation

Kwpolska
Copy link
Member

@Kwpolska Kwpolska commented Apr 14, 2018

New behavior:

$ nikola build
[2018-04-14T17:09:38Z] ERROR: Nikola: Post 'pages/index.rst': output path (output/index.html) conflicts with the blog index (output/index.html). Please change INDEX_PATH or disable index generation.
[2018-04-14T17:09:39Z] ERROR: Nikola: Post 'pages/index.rst': output path (output/es/index.html) conflicts with the blog index (output/es/index.html). Please change INDEX_PATH or disable index generation.
ERROR: Two different tasks can't have a common target.'output/index.html' is a target for render_taxonomies:output/index.html and render_pages:output/index.html.

cc @felixfontein @tbm

@Kwpolska Kwpolska added this to the v8.0.0 milestone Apr 14, 2018
@Kwpolska Kwpolska requested a review from ralsina April 14, 2018 17:21
@tbm
Copy link
Contributor

tbm commented Apr 14, 2018

I just applied the patch and this is much clearer.

Thank you!

@Kwpolska Kwpolska force-pushed the fix-3022-better-index-html-conflict-errors branch from 4284929 to 90c2e4a Compare April 14, 2018 17:41
Copy link
Contributor

@felixfontein felixfontein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, except two small things you might want to consider

@@ -43,9 +45,17 @@ def gen_tasks(self):
"filters": self.site.config["FILTERS"],
"show_untranslated_posts": self.site.config['SHOW_UNTRANSLATED_POSTS'],
"demote_headers": self.site.config['DEMOTE_HEADERS'],
"disable_indexes": self.site.config["DISABLE_INDEXES_PLUGIN_INDEX_AND_ATOM_FEED"],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it a good idea to put this into kw? After all, this value is only needed at task generation time, and its use does not require a rebuild of all pages if it changes.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, it’s not really needed.

LOGGER.error(
"Post {0!r}: output path ({1}) conflicts with the blog index ({2}). "
"Please change INDEX_PATH or disable index generation.".format(
post.source_path, task['name'], index_paths[lang]))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe mention DISABLE_INDEXES_PLUGIN_INDEX_AND_ATOM_FEED as a way to disable index generation. That should make it easier for users to react on this message. (And they also see that this affects Atom feed generation.)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Speaking of which, this config setting has a terrible name which should be changed in v8.

Signed-off-by: Chris Warrick <kwpolska@gmail.com>
Signed-off-by: Chris Warrick <kwpolska@gmail.com>
Signed-off-by: Chris Warrick <kwpolska@gmail.com>
@Kwpolska Kwpolska force-pushed the fix-3022-better-index-html-conflict-errors branch from 2be84b8 to a9be3c7 Compare April 15, 2018 12:02
@Kwpolska Kwpolska merged commit c5b7b96 into master Apr 15, 2018
@Kwpolska Kwpolska deleted the fix-3022-better-index-html-conflict-errors branch April 15, 2018 12:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants