change directories names

This commit is contained in:
Ruidy 2023-06-29 20:47:44 +02:00
parent fef2022767
commit 7d16193c91
14 changed files with 4 additions and 6 deletions

View file

@ -6,7 +6,7 @@
You can build the site using the built-in static site generator included.
To create a page, create a `toml` file in the `pages` directory. It should contain at least the following fields:
To create a page, create a `html` file in the `pages` directory. It should contain at least the following fields:
```toml
name = "index"
@ -17,7 +17,7 @@ You can add other fields they will become available in the template.
The entry point is located in the [main file](./lib/main.py). It should not be modified.
By default, the templates files are located in the [templates](./templates) directory.
By default, the templates files are located in the [templates](./pages) directory.
You can use template inheritance.
### Configuration

View file

@ -2,8 +2,6 @@ import tomllib
from dataclasses import dataclass
NAME = "name"
TEMPLATES_DIR = "templates_dir"
STATIC_FILES = "static_files"
OUT_DIR = "out_dir"
@ -22,5 +20,5 @@ def load() -> Config:
name=raw_config[NAME],
static_files="assets",
out_dir=raw_config.setdefault(OUT_DIR, "dist"),
templates_dir=raw_config.setdefault(TEMPLATES_DIR, "templates"),
templates_dir="pages",
)

View file

@ -24,7 +24,7 @@ def main():
clean_dist(destination_path)
pages = [page for page in os.scandir("./pages") if page.is_file()]
pages = [page for page in os.scandir("./data") if page.is_file()]
for page in pages:
with open(page, "rb") as f:
data = tomllib.load(f)