From c9b84abe46fae6c921c36ea1bffd86fadbafd478 Mon Sep 17 00:00:00 2001 From: Jamie Culpon Date: Wed, 4 Dec 2013 09:32:52 -0800 Subject: [PATCH] Make marking articles as drafts case-insensitive Previously if you tried to mark an article as a draft by using a different casing (for example, draft) you would get a warning when building: `Unknown status Draft for file foo.md, skipping it.` This uses a case-insensitive comparison when looking at article status instead. I believe this behavior is a little easier for new Pelican users. --- pelican/generators.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pelican/generators.py b/pelican/generators.py index 00801697..2fbb0e1c 100644 --- a/pelican/generators.py +++ b/pelican/generators.py @@ -407,9 +407,9 @@ class ArticlesGenerator(Generator): self.add_source_path(article) - if article.status == "published": + if article.status.lower() == "published": all_articles.append(article) - elif article.status == "draft": + elif article.status.lower() == "draft": self.drafts.append(article) else: logger.warning("Unknown status %s for file %s, skipping it." %