mirror of
https://github.com/rjNemo/vf-site
synced 2026-06-06 01:16:38 +00:00
change directories names
This commit is contained in:
parent
fef2022767
commit
7d16193c91
14 changed files with 4 additions and 6 deletions
|
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
You can build the site using the built-in static site generator included.
|
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
|
```toml
|
||||||
name = "index"
|
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.
|
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.
|
You can use template inheritance.
|
||||||
|
|
||||||
### Configuration
|
### Configuration
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,6 @@ import tomllib
|
||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
|
|
||||||
NAME = "name"
|
NAME = "name"
|
||||||
TEMPLATES_DIR = "templates_dir"
|
|
||||||
STATIC_FILES = "static_files"
|
|
||||||
OUT_DIR = "out_dir"
|
OUT_DIR = "out_dir"
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -22,5 +20,5 @@ def load() -> Config:
|
||||||
name=raw_config[NAME],
|
name=raw_config[NAME],
|
||||||
static_files="assets",
|
static_files="assets",
|
||||||
out_dir=raw_config.setdefault(OUT_DIR, "dist"),
|
out_dir=raw_config.setdefault(OUT_DIR, "dist"),
|
||||||
templates_dir=raw_config.setdefault(TEMPLATES_DIR, "templates"),
|
templates_dir="pages",
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ def main():
|
||||||
|
|
||||||
clean_dist(destination_path)
|
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:
|
for page in pages:
|
||||||
with open(page, "rb") as f:
|
with open(page, "rb") as f:
|
||||||
data = tomllib.load(f)
|
data = tomllib.load(f)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue