diff --git a/render.py b/render.py index 17f60bf..cc69e3c 100644 --- a/render.py +++ b/render.py @@ -92,12 +92,15 @@ def site(data, injectSSL = False): ssl = '' if injectSSL: ssl = '' - - html = render_template('page.html', title=title, links=links, image=image, + page = "page.html" + if data['image'] == "": + page = "page_no_image.html" + html = render_template(page, title=title, links=links, image=image, bg_0=data['bg_0'], bg_1=data['bg_1'], fg_0=data['fg_0'], btn_bg=data['btn_bg'], btn_fg=data['btn_fg'], socials=socials, addresses=addresses + ssl) - html = html.replace('/assets/img/favicon.png',f'/avatar/{data["image"]}') + if data['image'] != "": + html = html.replace('/assets/img/favicon.png',f'/avatar/{data["image"]}') return html diff --git a/templates/page_no_image.html b/templates/page_no_image.html new file mode 100644 index 0000000..0783bbf --- /dev/null +++ b/templates/page_no_image.html @@ -0,0 +1,57 @@ + + + + + + + {{title}} + + + + + + + + + + + + + + + + + +
+

{{title}}

+ {{addresses|safe}} +
+
+ +
+
+ +
+{{links|safe}} +
+
+ + + + + + + \ No newline at end of file diff --git a/templates/site.html b/templates/site.html index 3c7fc46..5a73fa0 100644 --- a/templates/site.html +++ b/templates/site.html @@ -118,6 +118,7 @@ +

You need to add these records to your domain after publishing your site