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
DEPLOY_DRAFTS and DEPLOY_FUTURE ignored by github_deploy #2406
Comments
Cannot reproduce. Please apply this patch over diff --git a/nikola/plugins/command/deploy.py b/nikola/plugins/command/deploy.py
index 365c0a3..95fbfec 100644
--- a/nikola/plugins/command/deploy.py
+++ b/nikola/plugins/command/deploy.py
@@ -97,9 +97,14 @@ class CommandDeploy(Command):
for post in self.site.timeline:
if (not deploy_drafts and post.is_draft) or \
(not deploy_future and post.publish_later):
+ print("Delete", post, post.is_draft, post.publish_later)
remove_file(os.path.join(out_dir, post.destination_path()))
remove_file(os.path.join(out_dir, post.source_path))
undeployed_posts.append(post)
+ else:
+ print("Deploy", post, post.is_draft, post.publish_later)
+ else:
+ print("DEPLOY_DRAFTS and DEPLOY_FUTURE are both True")
if args:
presets = args |
I suspect |
The source file path is incorrect, and the following patch should help. diff --git a/nikola/plugins/command/deploy.py b/nikola/plugins/command/deploy.py
index 365c0a3..1e772c9 100644
--- a/nikola/plugins/command/deploy.py
+++ b/nikola/plugins/command/deploy.py
@@ -98,7 +98,8 @@ class CommandDeploy(Command):
if (not deploy_drafts and post.is_draft) or \
(not deploy_future and post.publish_later):
remove_file(os.path.join(out_dir, post.destination_path()))
- remove_file(os.path.join(out_dir, post.source_path))
+ source_path = post.destination_path(extension=post.source_ext(True))
+ remove_file(os.path.join(out_dir, source_path))
undeployed_posts.append(post)
if args: |
@ChillarAnand could you test @punchagan’s patch and see if it helps in your case? |
My bad. Looks like I overlooked the issue. I was deploying to github pages and ghp-import was commiting even drafts to github. Is there a way to disable this? |
Were you using |
Yes, I was using that. |
Fix #2406 -- respect DEPLOY_* in github_deploy
With these settings, drafts with past dates are getting deployed.
The text was updated successfully, but these errors were encountered: