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):
|
||||
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())
|
||||
|
@ -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:
|
||||
|
@ -0,0 +1,6 @@
|
||||
|
||||
|
||||
img {
|
||||
width: 1000px;
|
||||
height: 1000px;
|
||||
}
|
@ -6,7 +6,7 @@
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<h1>{{ category.name }}</h1>
|
||||
{{ content }}
|
||||
</body>
|
||||
|
||||
</html>
|
Reference in New Issue
Block a user