core: gen thumb, small, readme for every image

This commit is contained in:
starnakin 2025-05-02 13:36:57 -04:00
parent 08c0129af8
commit d0063c2cc4
2 changed files with 5 additions and 0 deletions

View File

@ -27,6 +27,7 @@ class Page():
self.html: Path = Path(self._path, "page.html") self.html: Path = Path(self._path, "page.html")
self.prev: Page = prev self.prev: Page = prev
self.next: Page = next self.next: Page = next
self._readme.touch()
def add_picture(self, picture: Picture) -> None: def add_picture(self, picture: Picture) -> None:
self._pictures.append(picture) self._pictures.append(picture)
@ -47,6 +48,8 @@ class Page():
return None return None
with open(self._readme.get_absolute_path(), 'r') as f: with open(self._readme.get_absolute_path(), 'r') as f:
text = f.read() text = f.read()
if len(text) == 0:
return None
html = markdown.markdown(text) html = markdown.markdown(text)
return html return html

View File

@ -33,6 +33,8 @@ class Picture():
if (config.CREATE_GENERAL_ALBUM): if (config.CREATE_GENERAL_ALBUM):
self._albums_name.append("general") self._albums_name.append("general")
self._is_reperoried: bool = is_repertoried self._is_reperoried: bool = is_repertoried
self.gen_small()
self.gen_thumb()
def get_page(self): def get_page(self):
return self._page return self._page