Skip to content

Commit

Permalink
Add disabled status for #3304 (POC)
Browse files Browse the repository at this point in the history
  • Loading branch information
GiovanH committed May 19, 2024
1 parent b1cb6c7 commit c932252
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pelican/contents.py
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ def refresh_metadata_intersite_links(self):

class Page(Content):
mandatory_properties = ("title",)
allowed_statuses = ("published", "hidden", "draft")
allowed_statuses = ("published", "hidden", "draft", "disabled")
default_status = "published"
default_template = "page"

Expand All @@ -541,7 +541,7 @@ def _expand_settings(self, key):

class Article(Content):
mandatory_properties = ("title", "date", "category")
allowed_statuses = ("published", "hidden", "draft")
allowed_statuses = ("published", "hidden", "draft", "disabled")
default_status = "published"
default_template = "article"

Expand Down
5 changes: 5 additions & 0 deletions pelican/generators.py
Original file line number Diff line number Diff line change
Expand Up @@ -687,6 +687,8 @@ def generate_context(self):
all_drafts.append(article)
elif article.status == "hidden":
hidden_articles.append(article)
elif article.status == "disabled":
pass

self.add_source_path(article)
self.add_static_links(article)
Expand Down Expand Up @@ -891,6 +893,9 @@ def generate_context(self):
hidden_pages.append(page)
elif page.status == "draft":
draft_pages.append(page)
elif page.status == "disabled":
pass

self.add_source_path(page)
self.add_static_links(page)

Expand Down

0 comments on commit c932252

Please sign in to comment.