mirror of
https://github.com/rjNemo/vf-site
synced 2026-06-06 09:16:39 +00:00
23 lines
478 B
Python
23 lines
478 B
Python
import tomllib
|
|
from dataclasses import dataclass
|
|
|
|
|
|
@dataclass(frozen=True)
|
|
class Config:
|
|
name: str
|
|
static_dir: str
|
|
data_dir: str
|
|
out_dir: str
|
|
templates_dir: str
|
|
|
|
|
|
def load() -> Config:
|
|
with open("config.toml", "rb") as f:
|
|
raw_config = tomllib.load(f)
|
|
return Config(
|
|
name=raw_config["name"],
|
|
static_dir="assets",
|
|
data_dir="data",
|
|
out_dir="dist",
|
|
templates_dir="pages",
|
|
)
|