1
0
Fork 0
forked from github/pelican

Add disabled status for #3304 (#3305)

This commit is contained in:
GiovanH 2024-09-12 06:28:51 -05:00 committed by GitHub
commit 4201256a5b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 56 additions and 7 deletions

View file

@ -547,9 +547,29 @@ class Content:
self._summary = self.metadata["summary"]
class SkipStub(Content):
"""Stub class representing content that should not be processed in any way."""
def __init__(
self, content, metadata=None, settings=None, source_path=None, context=None
):
self.source_path = source_path
def is_valid(self):
return False
@property
def content(self):
raise NotImplementedError("Stub content should not be read")
@property
def save_as(self):
raise NotImplementedError("Stub content cannot be saved")
class Page(Content):
mandatory_properties = ("title",)
allowed_statuses = ("published", "hidden", "draft")
allowed_statuses = ("published", "hidden", "draft", "skip")
default_status = "published"
default_template = "page"
@ -560,7 +580,7 @@ class Page(Content):
class Article(Content):
mandatory_properties = ("title", "date", "category")
allowed_statuses = ("published", "hidden", "draft")
allowed_statuses = ("published", "hidden", "draft", "skip")
default_status = "published"
default_template = "article"