Add support for future post publication
This commit is contained in:
parent
1c371e8c1f
commit
cb275ad95d
6
build.py
6
build.py
@ -122,6 +122,12 @@ class ConfigSerializer(msh.Schema):
|
||||
f"Post slugs used multiple times: {set([item for item in slugs if slugs.count(item) > 1])}"
|
||||
)
|
||||
|
||||
@msh.post_load
|
||||
def _remove_future(self, data: Dict[str, Any], *args, **kwargs) -> PostContainer:
|
||||
posts = [item for item in data["posts"] if item.date >= datetime.date.today()]
|
||||
data["posts"] = posts
|
||||
return data
|
||||
|
||||
|
||||
def get_args() -> argparse.Namespace:
|
||||
parser = argparse.ArgumentParser()
|
||||
|
Loading…
Reference in New Issue
Block a user