add: css to page
This commit is contained in:
@ -111,6 +111,7 @@ def scan_pages(site_path: Path, markdown: Photodown):
|
|||||||
|
|
||||||
def gen_pages(site_path: Path, markdown: Photodown):
|
def gen_pages(site_path: Path, markdown: Photodown):
|
||||||
scan_pages(site_path, markdown)
|
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):
|
def regen(bulk_path: Path, is_thumb: bool, is_small: bool):
|
||||||
pages: list[BulkPage] = scan_bulk_pages(bulk_path.get_dirs())
|
pages: list[BulkPage] = scan_bulk_pages(bulk_path.get_dirs())
|
||||||
|
@ -7,6 +7,11 @@ from path import Path
|
|||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from photodown import Photodown
|
from photodown import Photodown
|
||||||
|
|
||||||
|
from jinja2 import Environment, FileSystemLoader
|
||||||
|
|
||||||
|
env = Environment(loader=FileSystemLoader('src/templates'))
|
||||||
|
page_template = env.get_template('page.jinja')
|
||||||
class Page:
|
class Page:
|
||||||
|
|
||||||
def __init__(self, path: Path, markdown: Photodown):
|
def __init__(self, path: Path, markdown: Photodown):
|
||||||
@ -21,7 +26,7 @@ class Page:
|
|||||||
return content
|
return content
|
||||||
|
|
||||||
def _to_html(self) -> str:
|
def _to_html(self) -> str:
|
||||||
html: str = self._get_content()
|
html: str = page_template.render(content=self._get_content())
|
||||||
return html
|
return html
|
||||||
|
|
||||||
def create(self) -> Path:
|
def create(self) -> Path:
|
||||||
|
@ -0,0 +1,6 @@
|
|||||||
|
|
||||||
|
|
||||||
|
img {
|
||||||
|
width: 1000px;
|
||||||
|
height: 1000px;
|
||||||
|
}
|
@ -6,7 +6,7 @@
|
|||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<h1>{{ category.name }}</h1>
|
{{ content }}
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
Reference in New Issue
Block a user