add galery wip

This commit is contained in:
Valentin CZERYBA 2023-08-12 00:06:09 +02:00
parent e4eb1b6b68
commit 5959ab5b2e
2 changed files with 9 additions and 0 deletions

1
.gitignore vendored
View File

@ -2,3 +2,4 @@ backup*/
wp-navigation wp-navigation
*.log *.log
__pycache__/ __pycache__/
wp-gallery

View File

@ -180,6 +180,14 @@ class WPimport:
except Exception as err: except Exception as err:
self._logger.error("{0} : Exception error for get image : {1}".format(self._name, err)) self._logger.error("{0} : Exception error for get image : {1}".format(self._name, err))
exit(1) exit(1)
content_html = "<!-- wp:paragraph --><p>{0}</p><!-- /wp:paragraph -->\n\n".format(albumdesc)
content_html = content_html + "<figure class=\"wp-block-gallery has-nested-images columns-default is-cropped\"><!-- wp:image {'id':{0},\"sizeSlug\":\"large\",\"linkDestination\":\"none\"} --><figure class=\"wp-block-image size-large'><img src=\"{1}\" alt=\"\" class=\"wp-image-{0}\"/></figure><!-- /wp:image --> \n\n".format(list_img[0]["id"],list_img[1]["new_src"])
for i in range(1, len(list_img)):
content_html = content_html + "<!-- wp:image {'id':{0},\"sizeSlug\":\"large\",\"linkDestination\":\"none\"} --><figure class=\"wp-block-image size-large\"><img src='{0}' alt=\"\" class='wp-image-{1}'/></figure><!-- /wp:image -->\n\n".format(list_img[i]["id"],list_img[i]["new_src"])
content_html = content_html + "<!-- /wp:gallery -->"
def _fromFileTmp(self): def _fromFileTmp(self):