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

Conditionally abort on conflicting article paths? #446

Closed
abg opened this issue Jul 31, 2012 · 3 comments
Closed

Conditionally abort on conflicting article paths? #446

abg opened this issue Jul 31, 2012 · 3 comments
Labels
Milestone

Comments

@abg
Copy link

abg commented Jul 31, 2012

Right now it seems that if I accidentally define the same slug, one of the articles arbitrarily wins and may (depending on my ARTICLE_* settings) overwrite some other article. Ideally I would like the ability to see an error in that case as a safety check to avoid accidentally blowing away content when I publish.

Currently there's a warning for overlapping slugs in utils.process_translations, but I would like the ability for an error and non-zero exit status when overwriting other content to handle aborting in an automated publish script more easily.

@almet
Copy link
Member

almet commented Oct 25, 2012

Yep, this makes sense. Including for 3.1 release.

Rogdham added a commit to Rogdham/pelican that referenced this issue Apr 14, 2013
Check that template-generated files don't override each other. Log a critical
message otherwise, and exit with non-zero status.
Also improve slug warnings: uniqueness is also checked for translations.
Rogdham added a commit to Rogdham/pelican that referenced this issue Apr 14, 2013
Check that template-generated files don't override each other. Log a critical
message otherwise, and exit with non-zero status.
@Rogdham
Copy link
Contributor

Rogdham commented Apr 14, 2013

I've started working on that: #848.

Two different things implemented:

  • if several posts have the same slug and the same language, a warning is displayed to the user (before it was only for non-translation posts)
  • if two templates generating files which would override a previously generated one, a critical error is displayed to the user, and pelican exits with non-zero status code

It needs more testing, in particular to know the impact on performances.

@Rogdham
Copy link
Contributor

Rogdham commented Apr 14, 2013

@justinmayer gave me a setting with 1419 posts to measure performances.

Before: make html 89.01s user 1.29s system 87% cpu 1:43.53 total
After: make html 89.68s user 1.26s system 90% cpu 1:41.02 total

I can conclude that it does not have bad impact on performances.

@almet almet closed this as completed in ff7410c May 13, 2013
almet added a commit that referenced this issue May 13, 2013
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

3 participants