🩹 add page titles
This commit is contained in:
parent
040fd333e2
commit
f9ce89fb4f
1 changed files with 8 additions and 7 deletions
15
src/index.py
15
src/index.py
|
@ -15,7 +15,7 @@ def download_file(url, file):
|
|||
r = requests.get(url, allow_redirects=True)
|
||||
open(file, "wb").write(r.content)
|
||||
|
||||
|
||||
# Downloads all bootstrap files to flasks static directory
|
||||
def cache_bootstrap():
|
||||
download_file(
|
||||
"https://cdn.jsdelivr.net/npm/bootstrap@5.2.0-beta1/dist/css/bootstrap.min.css",
|
||||
|
@ -58,14 +58,14 @@ def save_message(msg, name=""):
|
|||
f = open(f"/data/messages/{name}-{dt}.asc", "w")
|
||||
f.write(msg)
|
||||
|
||||
|
||||
# Send Notification to all handlers
|
||||
def notify(msg, title=None):
|
||||
try:
|
||||
gotify_notification(msg, title)
|
||||
except:
|
||||
pass
|
||||
|
||||
|
||||
# Gotify Notification Handler
|
||||
def gotify_notification(msg, title=None):
|
||||
token = CONFIG["notify"]["gotify"]["token"]
|
||||
url = CONFIG["notify"]["gotify"]["host"]
|
||||
|
@ -131,15 +131,16 @@ def send_message():
|
|||
css_class="container", style="margin-top: 25px"
|
||||
),
|
||||
)
|
||||
]
|
||||
], "Send a message"
|
||||
).to_code()
|
||||
|
||||
|
||||
# Wrapper for Base HTML
|
||||
def buildSite(content):
|
||||
def buildSite(content, title=None):
|
||||
return Document(
|
||||
head=Head(
|
||||
[
|
||||
Title(title),
|
||||
Meta(
|
||||
name="viewport",
|
||||
content="user-scalable=no, width=device-width, initial-scale=1.0",
|
||||
|
@ -190,7 +191,7 @@ def public_key():
|
|||
css_class="container card bg-primary"
|
||||
),
|
||||
),
|
||||
]
|
||||
], "Public Key"
|
||||
).to_code()
|
||||
|
||||
# Return raw key
|
||||
|
@ -273,5 +274,5 @@ def build_information_block():
|
|||
@main_pages.route("/", methods=["GET"])
|
||||
def index():
|
||||
return buildSite(
|
||||
[build_information_block(), build_contact_block(), build_donation_block()]
|
||||
[build_information_block(), build_contact_block(), build_donation_block()], "About Me"
|
||||
).to_code()
|
||||
|
|
Loading…
Add table
Reference in a new issue