bloggy 0.1.40__py3-none-any.whl → 0.2.3__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
bloggy/main.py CHANGED
@@ -89,8 +89,20 @@ def cli():
89
89
  print(f"Serving at: http://{host}:{port}")
90
90
  if host == '0.0.0.0':
91
91
  print(f"Server accessible from network at: http://<your-ip>:{port}")
92
+
93
+ # Configure reload to watch markdown and PDF files in the blog directory
94
+ reload_kwargs = {}
95
+ if reload:
96
+ blog_root = config.get_root_folder()
97
+ reload_kwargs = {
98
+ "reload": True,
99
+ "reload_dirs": [str(blog_root)],
100
+ "reload_includes": ["*.md", "*.pdf", "*.bloggy"]
101
+ }
102
+ else:
103
+ reload_kwargs = {"reload": False}
92
104
 
93
- uvicorn.run("bloggy.main:app", host=host, port=port, reload=reload)
105
+ uvicorn.run("bloggy.main:app", host=host, port=port, **reload_kwargs)
94
106
 
95
107
  if __name__ == "__main__":
96
- cli()
108
+ cli()