mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
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.
This commit is contained in:
parent
44ef4d3eaa
commit
c9b84abe46
1 changed files with 2 additions and 2 deletions
|
|
@ -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." %
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue