add: css to page

This commit is contained in:
2025-07-09 00:03:03 +02:00
parent 001a8c692e
commit cbab99cc82
4 changed files with 14 additions and 2 deletions

View File

@ -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())

View File

@ -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:

View File

@ -0,0 +1,6 @@
img {
width: 1000px;
height: 1000px;
}

View File

@ -6,7 +6,7 @@
</head>
<body>
<h1>{{ category.name }}</h1>
{{ content }}
</body>
</html>