summaryrefslogtreecommitdiff
path: root/modules/blogpost_processor.py
diff options
context:
space:
mode:
authorBotond Hende <nettingman@gmail.com>2024-09-07 18:41:43 +0200
committerBotond Hende <nettingman@gmail.com>2024-09-07 18:41:43 +0200
commita6da4080099d47f6e733bac021a1967c06242097 (patch)
tree3a4bc75d08e2f1cedc28d40da9185b3a1ba0fc83 /modules/blogpost_processor.py
parent903aa11ab7c8baed355cff4aaf112dbf487859f5 (diff)
only use unpublished content when building locally
Diffstat (limited to 'modules/blogpost_processor.py')
-rw-r--r--modules/blogpost_processor.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/modules/blogpost_processor.py b/modules/blogpost_processor.py
index a8833e2..f8c06c2 100644
--- a/modules/blogpost_processor.py
+++ b/modules/blogpost_processor.py
@@ -216,10 +216,13 @@ class Post:
return None
-def get_posts(path: str) -> list[Post]:
+def get_posts(path: str, local: bool) -> list[Post]:
return_list = []
for directory in os.listdir(path):
+ if directory.endswith(".unpublished") and not local:
+ continue
+
return_list.append(Post(os.path.join(path, directory)))
return_list.sort(key=lambda post: post.meta_data[PUBLISH_DATE_KEY], reverse=True)