feat: add app description config

This commit is contained in:
Ayo Ayco 2024-04-25 16:10:58 +02:00
parent 64f6308e86
commit 4ea9637e3a
2 changed files with 10 additions and 6 deletions

View file

@ -3,7 +3,7 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{{ title }}</title>
<title>{{ app.title }}</title>
<link rel="stylesheet" href="https://webcomponent.io/reset.css" />
<style>
body {
@ -102,8 +102,9 @@
</head>
<body>
<header>
<h1>{{ title }}</h1>
<a href="/">go home</a></nav>
<h1>{{ app.title }}</h1>
<p>{{ app.description }}</p>
</header>
<main>
<ul>
@ -181,7 +182,7 @@
</main>
<footer>
&copy; {{ attribution.year }} {{ attribution.owner }}
<p>See the <a href="https://ayco.io/sh/threads">source code</a>. Or <a href="/">go home</a>.</p>
<p>Powered by <a href="https://ayco.io/sh/threads">/threads</a></p>
</footer>
</body>
</html>

View file

@ -6,7 +6,10 @@ threads = Blueprint('threads', __name__, template_folder='template')
# TODO: move following to an app config or sqlite #########
server = 'https://social.ayco.io'
thread_ids = ['112319729193615365', '112258065967208438']
title = "Ayo's Threads"
app = {
"title":"Ayo's Threads",
"description": "Incubator for thoughts before they become a blog."
}
attribution = {
"owner": "Ayo Ayco",
"year": "2024"
@ -16,13 +19,13 @@ attribution = {
@threads.route('/')
def home():
statuses = fetch_statuses()
return render_template('threads.html', threads=statuses, title=title, attribution=attribution)
return render_template('threads.html', threads=statuses, app=app, attribution=attribution)
@threads.route('/<path:id>')
def thread(id):
if id in thread_ids:
status = fetch_thread(id)
return render_template('threads.html', threads=[status], title=title, attribution=attribution)
return render_template('threads.html', threads=[status], app=app, attribution=attribution)
else:
return '<h1>Not Found</h1><p>¯\_(ツ)_/¯</p><a href="/">go home</a>', 404