-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathsettings.py
35 lines (27 loc) · 908 Bytes
/
settings.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
"""
Configuration variables for site generation.
This script defines constants and settings used during the generation
of the website, such as folder paths, blog categories, volunteer
descriptions, and metadata loaded from an external JSON file.
"""
import json
import os
# Constants
OUTPUT_FOLDER = "docs/"
BLOG_CATEGORIES = ["main", "protocol"]
VOLUNTEERS_DESCS = {
"event": "Events collaborator/programmer",
"code": "Website/Projects maintainer",
"education": "Tutorials/Posts Flask related",
}
# Load metadata from info.json
def load_info(file_path="info.json"):
if not os.path.exists(file_path):
raise FileNotFoundError(f"File '{file_path}' not found.")
with open(file_path, encoding="utf-8") as f:
return json.load(f)
try:
INFO = load_info()
except (FileNotFoundError, json.JSONDecodeError) as e:
INFO = {}
print(f"Error loading info.json: {e}")