feat: Add empty site page
All checks were successful
Build Docker / Build SLDs Image (push) Successful in 18s
Build Docker / Build Main Image (push) Successful in 21s

This commit is contained in:
Nathan Woodburn 2023-11-18 19:05:50 +11:00
parent 07eb15bd0c
commit c7e38a7f22
Signed by: nathanwoodburn
GPG Key ID: 203B000478AD0EF1
9 changed files with 81 additions and 21 deletions

View File

@ -3,7 +3,7 @@ from bs4 import BeautifulSoup
import os
import dotenv
main_domain = "cities.hnshosting.au"
main_domain = "shakecities.com"
if os.getenv('MAIN_DOMAIN') != None:
main_domain = os.getenv('MAIN_DOMAIN')
@ -15,6 +15,8 @@ if os.path.exists("parts/footer.html"):
def render(data,db_object):
if data == False:
return redirect("https://" + main_domain + '/claim?domain=' + request.host.split('.')[0])
elif data == "":
return redirect("https://" + main_domain + '/empty_site')
# Render as HTML
html = ""
@ -24,16 +26,12 @@ def render(data,db_object):
try:
soup = BeautifulSoup(data, 'html.parser')
# for script in soup.find_all('script'):
# script.extract()
# Inject SSL
soup.append(BeautifulSoup(ssl, 'html.parser'))
html = str(soup)
except Exception as e:
return "<h1>Invalid HTML</h1><br>" + str(e)
return redirect("https://" + main_domain + '/empty_site')
try:
avatar = db_object['avatar']
@ -106,7 +104,7 @@ def render(data,db_object):
hns=hns,btc=btc,eth=eth, data=html,footer=footer)
except Exception as e:
return "<h1>Nothing here yet</h1>" + "<script>console.log('" + str(e).replace('\'','') + "');</script>"
return redirect("https://" + main_domain + '/empty_site')
def get_template(template,hide_addresses=False):
file = "templates/" +get_template_file(template)

View File

@ -45,9 +45,9 @@
</section>
<section style="margin: 20px;height: 40px;text-align: center;margin-top: 40px;">
<footer class="text-center bg-dark"></footer>
<div style="width: auto;display: inline-block;">
<div style="display: inline-block;">
<ul class="list-inline">
<li class="list-inline-item me-4">Copyright © ShakeCities 2023</li>
<li class="list-inline-item me-4" style="color: rgb(255,255,255);">Copyright © ShakeCities 2023</li>
<li class="list-inline-item me-4"><iframe src='https://uptime.woodburn.au/api/badge/54/uptime?labelPrefix=Main+Server+' style="height:1.3em;margin-bottom:-.3em;width: 13em;"></iframe></li>
<li class="list-inline-item me-4"><iframe src='https://uptime.woodburn.au/api/badge/55/uptime?labelPrefix=Cities+' style="height:1.3em;margin-bottom:-.3em;width:11em;"></iframe></li>
</ul>

View File

@ -68,9 +68,9 @@
</section>
<section style="margin: 20px;height: 40px;text-align: center;margin-top: 40px;">
<footer class="text-center bg-dark"></footer>
<div style="width: auto;display: inline-block;">
<div style="display: inline-block;">
<ul class="list-inline">
<li class="list-inline-item me-4">Copyright © ShakeCities 2023</li>
<li class="list-inline-item me-4" style="color: rgb(255,255,255);">Copyright © ShakeCities 2023</li>
<li class="list-inline-item me-4"><iframe src='https://uptime.woodburn.au/api/badge/54/uptime?labelPrefix=Main+Server+' style="height:1.3em;margin-bottom:-.3em;width: 13em;"></iframe></li>
<li class="list-inline-item me-4"><iframe src='https://uptime.woodburn.au/api/badge/55/uptime?labelPrefix=Cities+' style="height:1.3em;margin-bottom:-.3em;width:11em;"></iframe></li>
</ul>

62
templates/empty_site.html Normal file
View File

@ -0,0 +1,62 @@
<!DOCTYPE html>
<html data-bs-theme="light" lang="en" style="background: #000000;">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no">
<title>ShakeCities</title>
<meta name="twitter:description" content="Unlock web ownership's future with ShakeCities! Create your free, secure Handshake domain site. Integrate crypto payments, explore HNSChat, and join us in shaping the decentralized web!">
<meta name="description" content="Unlock web ownership's future with ShakeCities! Create your free, secure Handshake domain site. Integrate crypto payments, explore HNSChat, and join us in shaping the decentralized web!">
<meta name="twitter:card" content="summary">
<meta property="og:type" content="website">
<meta property="og:image" content="https://shakecities.com/assets/img/alexander-slattery-LI748t0BK8w-unsplash.webp">
<meta property="og:title" content="ShakeCities">
<meta name="twitter:title" content="ShakeCities">
<meta name="twitter:image" content="https://shakecities.com/assets/img/alexander-slattery-LI748t0BK8w-unsplash.webp">
<meta property="og:description" content="Unlock web ownership's future with ShakeCities! Create your free, secure Handshake domain site. Integrate crypto payments, explore HNSChat, and join us in shaping the decentralized web!">
<link rel="icon" type="image/png" sizes="670x700" href="assets/img/HNS.png">
<link rel="icon" type="image/png" sizes="670x700" href="assets/img/HNSW.png" media="(prefers-color-scheme: dark)">
<link rel="icon" type="image/png" sizes="670x700" href="assets/img/HNS.png">
<link rel="icon" type="image/png" sizes="670x700" href="assets/img/HNSW.png" media="(prefers-color-scheme: dark)">
<link rel="icon" type="image/png" sizes="670x700" href="assets/img/HNS.png">
<link rel="icon" type="image/png" sizes="670x700" href="assets/img/HNS.png">
<link rel="icon" type="image/png" sizes="670x700" href="assets/img/HNS.png">
<link rel="stylesheet" href="assets/bootstrap/css/bootstrap.min.css">
<link rel="stylesheet" href="assets/css/styles.min.css">
</head>
<body style="background: #000000;width: 95%;margin: auto;">
<section>
<section style="height: 15vh;background: url(&quot;assets/img/alexander-slattery-LI748t0BK8w-unsplash.webp&quot;) bottom / cover no-repeat;min-height: 130px;"></section>
<section class="d-print-none d-lg-none d-xl-none d-xxl-none" style="width: 30vw;border-radius: 50%;background: #000000;padding: 20px;height: 30vw;margin: auto;margin-top: -15vw;display: flex;"><a href="/"><img class="img-fluid" src="assets/img/HNSW.png" width="100%"></a></section>
<section class="d-print-none d-lg-none d-xl-none d-xxl-none" style="display: block;width: 100%;text-align: center;margin-top: 10px;">
<div style="display: inline-block;margin: auto;"><a class="btn btn-primary" role="button" style="margin: 10px;" href="/signup">Create your page</a><a class="btn btn-primary" role="button" style="margin: 10px;" href="/{{account_link}}">{{account_link_name}}</a></div>
</section>
<section class="d-none d-print-block d-lg-block d-xl-block d-xxl-block" style="display: block;">
<div style="width: 100%;text-align: right;margin-top: -4em;"></div>
</section>
<section class="d-none d-print-block d-lg-block d-xl-block d-xxl-block" style="width: 15vw;border-radius: 50%;background: #000000;padding: 20px;height: 15vw;margin: auto;display: flex;margin-top: -6vw;"><a href="/"><img class="img-fluid" src="assets/img/HNSW.png" width="100%"></a></section>
<section class="d-none d-print-block d-lg-block d-xl-block d-xxl-block" style="height: 3em;"></section>
</section>
<section style="width: 50%;margin: auto;margin-top: 50px;">
<div class="card bg-dark" style="padding-bottom: 40px;">
<div class="card-body">
<h4 class="card-title" style="color: rgb(255,255,255);">Nothing here yet</h4>
</div><a class="btn btn-primary" role="button" style="margin: 10px;" href="/">Back</a>
</div>
</section>
<section style="margin: 20px;height: 40px;text-align: center;margin-top: 40px;">
<footer class="text-center bg-dark"></footer>
<div style="display: inline-block;">
<ul class="list-inline">
<li class="list-inline-item me-4" style="color: rgb(255,255,255);">Copyright © ShakeCities 2023</li>
<li class="list-inline-item me-4"><iframe src='https://uptime.woodburn.au/api/badge/54/uptime?labelPrefix=Main+Server+' style="height:1.3em;margin-bottom:-.3em;width: 13em;"></iframe></li>
<li class="list-inline-item me-4"><iframe src='https://uptime.woodburn.au/api/badge/55/uptime?labelPrefix=Cities+' style="height:1.3em;margin-bottom:-.3em;width:11em;"></iframe></li>
</ul>
</div>
</section>
<script src="assets/bootstrap/js/bootstrap.min.js"></script>
<script src="assets/js/script.min.js"></script>
</body>
</html>

View File

@ -48,9 +48,9 @@
</section>
<section style="margin: 20px;height: 40px;text-align: center;margin-top: 40px;">
<footer class="text-center bg-dark"></footer>
<div style="width: auto;display: inline-block;">
<div style="display: inline-block;">
<ul class="list-inline">
<li class="list-inline-item me-4">Copyright © ShakeCities 2023</li>
<li class="list-inline-item me-4" style="color: rgb(255,255,255);">Copyright © ShakeCities 2023</li>
<li class="list-inline-item me-4"><iframe src='https://uptime.woodburn.au/api/badge/54/uptime?labelPrefix=Main+Server+' style="height:1.3em;margin-bottom:-.3em;width: 13em;"></iframe></li>
<li class="list-inline-item me-4"><iframe src='https://uptime.woodburn.au/api/badge/55/uptime?labelPrefix=Cities+' style="height:1.3em;margin-bottom:-.3em;width:11em;"></iframe></li>
</ul>

View File

@ -49,9 +49,9 @@
</section>
<section style="margin: 20px;height: 40px;text-align: center;margin-top: 40px;">
<footer class="text-center bg-dark"></footer>
<div style="width: auto;display: inline-block;">
<div style="display: inline-block;">
<ul class="list-inline">
<li class="list-inline-item me-4">Copyright © ShakeCities 2023</li>
<li class="list-inline-item me-4" style="color: rgb(255,255,255);">Copyright © ShakeCities 2023</li>
<li class="list-inline-item me-4"><iframe src='https://uptime.woodburn.au/api/badge/54/uptime?labelPrefix=Main+Server+' style="height:1.3em;margin-bottom:-.3em;width: 13em;"></iframe></li>
<li class="list-inline-item me-4"><iframe src='https://uptime.woodburn.au/api/badge/55/uptime?labelPrefix=Cities+' style="height:1.3em;margin-bottom:-.3em;width:11em;"></iframe></li>
</ul>

View File

@ -97,9 +97,9 @@
</section>
<section style="margin: 20px;height: 40px;text-align: center;margin-top: 40px;">
<footer class="text-center bg-dark"></footer>
<div style="width: auto;display: inline-block;">
<div style="display: inline-block;">
<ul class="list-inline">
<li class="list-inline-item me-4">Copyright © ShakeCities 2023</li>
<li class="list-inline-item me-4" style="color: rgb(255,255,255);">Copyright © ShakeCities 2023</li>
<li class="list-inline-item me-4"><iframe src='https://uptime.woodburn.au/api/badge/54/uptime?labelPrefix=Main+Server+' style="height:1.3em;margin-bottom:-.3em;width: 13em;"></iframe></li>
<li class="list-inline-item me-4"><iframe src='https://uptime.woodburn.au/api/badge/55/uptime?labelPrefix=Cities+' style="height:1.3em;margin-bottom:-.3em;width:11em;"></iframe></li>
</ul>

View File

@ -48,9 +48,9 @@
</section>
<section style="margin: 20px;height: 40px;text-align: center;margin-top: 40px;">
<footer class="text-center bg-dark"></footer>
<div style="width: auto;display: inline-block;">
<div style="display: inline-block;">
<ul class="list-inline">
<li class="list-inline-item me-4">Copyright © ShakeCities 2023</li>
<li class="list-inline-item me-4" style="color: rgb(255,255,255);">Copyright © ShakeCities 2023</li>
<li class="list-inline-item me-4"><iframe src='https://uptime.woodburn.au/api/badge/54/uptime?labelPrefix=Main+Server+' style="height:1.3em;margin-bottom:-.3em;width: 13em;"></iframe></li>
<li class="list-inline-item me-4"><iframe src='https://uptime.woodburn.au/api/badge/55/uptime?labelPrefix=Cities+' style="height:1.3em;margin-bottom:-.3em;width:11em;"></iframe></li>
</ul>

View File

@ -50,9 +50,9 @@
</section>
<section style="margin: 20px;height: 40px;text-align: center;margin-top: 40px;">
<footer class="text-center bg-dark"></footer>
<div style="width: auto;display: inline-block;">
<div style="display: inline-block;">
<ul class="list-inline">
<li class="list-inline-item me-4">Copyright © ShakeCities 2023</li>
<li class="list-inline-item me-4" style="color: rgb(255,255,255);">Copyright © ShakeCities 2023</li>
<li class="list-inline-item me-4"><iframe src='https://uptime.woodburn.au/api/badge/54/uptime?labelPrefix=Main+Server+' style="height:1.3em;margin-bottom:-.3em;width: 13em;"></iframe></li>
<li class="list-inline-item me-4"><iframe src='https://uptime.woodburn.au/api/badge/55/uptime?labelPrefix=Cities+' style="height:1.3em;margin-bottom:-.3em;width:11em;"></iframe></li>
</ul>