Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions brigid/library/discovering.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,10 @@ def load_pages(directory: pathlib.Path) -> None:

for page_path in page_paths:
page = load_page(page_path)

if page.exclude:
continue

storage.add_page(page)


Expand Down
2 changes: 2 additions & 0 deletions brigid/library/entities.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,8 @@ class Page(BaseEntity):

series: str | None = None

exclude: bool = False

@cached_property
def id(self) -> str:
return f"page#{self.language}#{self.slug}"
Expand Down
2 changes: 1 addition & 1 deletion changes/unreleased.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@

No changes.
- gh-119 — Added option to hide pages.
2 changes: 2 additions & 0 deletions test-content/posts/2025-001-all-pages-hidden/article.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

slug = "all-pages-hidden"
10 changes: 10 additions & 0 deletions test-content/posts/2025-001-all-pages-hidden/en.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
exclude = true
title = "Users must not see this post"
tags = ["this-tag-must-not-be-displayed"]
published_at = "2025-07-09T12:00:00+00:00"
seo_description = "The post must not be processed by Brigid in any way."
seo_image = ""
---

The post must not be processed by Brigid in any way.
10 changes: 10 additions & 0 deletions test-content/posts/2025-001-all-pages-hidden/ru.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
exclude = true
title = "Users must not see this post"
tags = ["this-tag-must-not-be-displayed"]
published_at = "2025-07-09T12:00:00+00:00"
seo_description = "The post must not be processed by Brigid in any way."
seo_image = ""
---

The post must not be processed by Brigid in any way.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

slug = "some-pages-are-hidden"
9 changes: 9 additions & 0 deletions test-content/posts/2025-002-some-pages-are-hidden/en.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
title = "RU version of this post is hidden"
tags = []
published_at = "2025-07-09T12:00:00+00:00"
seo_description = "RU version of this post is hidden"
seo_image = ""
---

You must see only the English version of this post. The Russian version is hidden.
10 changes: 10 additions & 0 deletions test-content/posts/2025-002-some-pages-are-hidden/ru.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
exclude = true
title = "Users must not see this post"
tags = ["this-tag-must-not-be-displayed"]
published_at = "2025-07-09T12:00:00+00:00"
seo_description = "The post must not be processed by Brigid in any way."
seo_image = ""
---

The post must not be processed by Brigid in any way.