diff --git a/src/main.py b/src/main.py index 4644f6f..0d59c2e 100644 --- a/src/main.py +++ b/src/main.py @@ -111,6 +111,7 @@ def scan_pages(site_path: Path, markdown: Photodown): def gen_pages(site_path: Path, markdown: Photodown): scan_pages(site_path, markdown) + Path("./src/templates/page.css").copy_to(Path(site_path, "page.css")) def regen(bulk_path: Path, is_thumb: bool, is_small: bool): pages: list[BulkPage] = scan_bulk_pages(bulk_path.get_dirs()) diff --git a/src/page.py b/src/page.py index bba23bb..1be425f 100644 --- a/src/page.py +++ b/src/page.py @@ -7,6 +7,11 @@ from path import Path if TYPE_CHECKING: from photodown import Photodown + +from jinja2 import Environment, FileSystemLoader + +env = Environment(loader=FileSystemLoader('src/templates')) +page_template = env.get_template('page.jinja') class Page: def __init__(self, path: Path, markdown: Photodown): @@ -21,7 +26,7 @@ class Page: return content def _to_html(self) -> str: - html: str = self._get_content() + html: str = page_template.render(content=self._get_content()) return html def create(self) -> Path: diff --git a/src/templates/page.css b/src/templates/page.css index e69de29..f72a8de 100644 --- a/src/templates/page.css +++ b/src/templates/page.css @@ -0,0 +1,6 @@ + + +img { + width: 1000px; + height: 1000px; +} \ No newline at end of file diff --git a/src/templates/page.jinja b/src/templates/page.jinja index 64fd6cf..caca512 100644 --- a/src/templates/page.jinja +++ b/src/templates/page.jinja @@ -6,7 +6,7 @@ -

{{ category.name }}

+ {{ content }} \ No newline at end of file