fix: Page without image

This commit is contained in:
Nathan Woodburn 2024-02-25 14:52:03 +11:00
parent 986f14f8e8
commit c7888d790f
Signed by: nathanwoodburn
GPG Key ID: 203B000478AD0EF1
3 changed files with 64 additions and 3 deletions

View File

@ -92,11 +92,14 @@ def site(data, injectSSL = False):
ssl = ''
if injectSSL:
ssl = '<script src="https://nathan.woodburn/https.js" async=""></script>'
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)
if data['image'] != "":
html = html.replace('/assets/img/favicon.png',f'/avatar/{data["image"]}')
return html

View File

@ -0,0 +1,57 @@
<!DOCTYPE html>
<html data-bs-theme="light" lang="en" style="text-align: center;">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no">
<title>{{title}}</title>
<meta name="twitter:title" content="{{title}}">
<meta property="og:title" content="{{title}}">
<meta name="description" content="{{title}}">
<meta property="og:description" content="{{title}}">
<meta name="twitter:description" content="{{title}}">
<link rel="icon" type="image/png" sizes="600x627" href="/assets/img/favicon.png">
<link rel="icon" type="image/png" sizes="600x627" href="/assets/img/favicon.png">
<link rel="icon" type="image/png" sizes="600x627" href="/assets/img/favicon.png">
<link rel="icon" type="image/png" sizes="600x627" href="/assets/img/favicon.png">
<link rel="icon" type="image/png" sizes="600x627" href="/assets/img/favicon.png">
<link rel="stylesheet" href="/assets/bootstrap/css/bootstrap.min.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Inter:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800&amp;display=swap">
<link rel="stylesheet" href="/assets/css/styles.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css">
</head>
<body style="background: transparent;">
<div style="border-radius: 20px;">
<h1 style="margin-top: 125px;">{{title}}</h1> <div class="addresses">
{{addresses|safe}}
</div>
<!-- <div style="height:25px;"></div> --> <div class="social-div">
<ul class="list-unstyled social-list">
{{socials|safe}}
</ul>
</div>
<div style="height:25px;"></div><style>
.custom-button:hover {
background-color: {{btn_fg}} !important;
color: {{btn_bg}} !important;
}
html {
background: linear-gradient({{bg_0}} 0%, {{bg_1}} 100%); color:{{fg_0}};"
}
body {
min-height: 100vh;
}
</style>
<div>
{{links|safe}}
</div>
</div>
<script src="/assets/js/jquery.min.js"></script>
<script src="/assets/bootstrap/js/bootstrap.min.js"></script>
<script src="https://auth.varo.domains/v1"></script>
<script src="/assets/js/script.min.js"></script>
</body>
</html>

View File

@ -118,6 +118,7 @@
</tbody>
</table>
</div>
<p>You need to add these records to your domain after publishing your site</p>
</div>
</section>
<footer class="bg-dark">