diff --git a/README.md b/README.md index c08a183..060e70a 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/pages/contact.toml b/data/contact.toml similarity index 100% rename from pages/contact.toml rename to data/contact.toml diff --git a/pages/index.toml b/data/index.toml similarity index 100% rename from pages/index.toml rename to data/index.toml diff --git a/pages/reservation.toml b/data/reservation.toml similarity index 100% rename from pages/reservation.toml rename to data/reservation.toml diff --git a/pages/t2-corail.toml b/data/t2-corail.toml similarity index 100% rename from pages/t2-corail.toml rename to data/t2-corail.toml diff --git a/pages/t3-azur.toml b/data/t3-azur.toml similarity index 100% rename from pages/t3-azur.toml rename to data/t3-azur.toml diff --git a/lib/config.py b/lib/config.py index 1df8270..54f0a83 100644 --- a/lib/config.py +++ b/lib/config.py @@ -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", ) diff --git a/lib/main.py b/lib/main.py index 217185d..e5222ec 100644 --- a/lib/main.py +++ b/lib/main.py @@ -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) diff --git a/templates/contact.html b/pages/contact.html similarity index 100% rename from templates/contact.html rename to pages/contact.html diff --git a/templates/index.html b/pages/index.html similarity index 100% rename from templates/index.html rename to pages/index.html diff --git a/templates/layout.html b/pages/layout.html similarity index 100% rename from templates/layout.html rename to pages/layout.html diff --git a/templates/reservation.html b/pages/reservation.html similarity index 100% rename from templates/reservation.html rename to pages/reservation.html diff --git a/templates/t2-corail.html b/pages/t2-corail.html similarity index 100% rename from templates/t2-corail.html rename to pages/t2-corail.html diff --git a/templates/t3-azur.html b/pages/t3-azur.html similarity index 100% rename from templates/t3-azur.html rename to pages/t3-azur.html