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

@ -19,7 +19,7 @@ from jinja2 import (
)
from pelican.cache import FileStampDataCacher
from pelican.contents import Article, Page, Static
from pelican.contents import Article, Page, SkipStub, Static
from pelican.plugins import signals
from pelican.plugins._utils import plugin_enabled
from pelican.readers import Readers
@ -690,6 +690,10 @@ class ArticlesGenerator(CachingGenerator):
self._add_failed_source_path(f)
continue
if isinstance(article, SkipStub):
logger.debug("Safely skipping %s", f)
continue
if not article.is_valid():
self._add_failed_source_path(f)
continue
@ -702,6 +706,8 @@ class ArticlesGenerator(CachingGenerator):
all_drafts.append(article)
elif article.status == "hidden":
hidden_articles.append(article)
elif article.status == "skip":
raise AssertionError("Documents with 'skip' status should be skipped")
self.add_source_path(article)
self.add_static_links(article)
@ -899,6 +905,10 @@ class PagesGenerator(CachingGenerator):
self._add_failed_source_path(f)
continue
if isinstance(page, SkipStub):
logger.debug("Safely skipping %s", f)
continue
if not page.is_valid():
self._add_failed_source_path(f)
continue
@ -911,6 +921,9 @@ class PagesGenerator(CachingGenerator):
hidden_pages.append(page)
elif page.status == "draft":
draft_pages.append(page)
elif page.status == "skip":
raise AssertionError("Documents with 'skip' status should be skipped")
self.add_source_path(page)
self.add_static_links(page)