core: gen thumb, small, readme for every image
This commit is contained in:
parent
08c0129af8
commit
d0063c2cc4
@ -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
|
||||||
|
|
||||||
|
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user