From c9322527135cab1dc40572fbd506a9eb0081e7b0 Mon Sep 17 00:00:00 2001 From: Gio Date: Sun, 19 May 2024 16:13:17 -0500 Subject: [PATCH] Add disabled status for #3304 (POC) --- pelican/contents.py | 4 ++-- pelican/generators.py | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/pelican/contents.py b/pelican/contents.py index 474e5bbfea..5bdefff558 100644 --- a/pelican/contents.py +++ b/pelican/contents.py @@ -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" @@ -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" diff --git a/pelican/generators.py b/pelican/generators.py index 3b5ca9e4b4..22e8fcc268 100644 --- a/pelican/generators.py +++ b/pelican/generators.py @@ -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) @@ -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)