This is an automated email from the ASF dual-hosted git repository.
sbp pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tooling-trusted-release.git
The following commit(s) were added to refs/heads/main by this push:
new 20f6cc0 Use a function for root route URL construction
20f6cc0 is described below
commit 20f6cc0a7bccfecb53e1813f5b177dd67ecba126
Author: Sean B. Palmer <[email protected]>
AuthorDate: Thu Mar 27 14:43:35 2025 +0200
Use a function for root route URL construction
---
atr/routes/root.py | 4 ++--
atr/templates/error.html | 2 +-
atr/templates/includes/sidebar.html | 4 ++--
atr/templates/notfound.html | 2 +-
4 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/atr/routes/root.py b/atr/routes/root.py
index fe9f2e0..a5a30ea 100644
--- a/atr/routes/root.py
+++ b/atr/routes/root.py
@@ -22,7 +22,7 @@ import quart
import atr.routes as routes
[email protected]_route("/")
-async def root() -> str:
[email protected]("/")
+async def index() -> str:
"""Main page."""
return await quart.render_template("index.html")
diff --git a/atr/templates/error.html b/atr/templates/error.html
index 763881a..3a76089 100644
--- a/atr/templates/error.html
+++ b/atr/templates/error.html
@@ -30,7 +30,7 @@
</div>
<div class="mt-4">
- <a href="{{ url_for('root') }}" class="btn btn-primary">Return to
Home</a>
+ <a href="{{ as_url(routes.root.index) }}" class="btn btn-primary">Return
to Home</a>
</div>
</div>
{% endblock content %}
diff --git a/atr/templates/includes/sidebar.html
b/atr/templates/includes/sidebar.html
index 70cf212..b3f33b8 100644
--- a/atr/templates/includes/sidebar.html
+++ b/atr/templates/includes/sidebar.html
@@ -1,6 +1,6 @@
<aside class="sidebar">
<div class="sidebar-header">
- <a href="{{ url_for('root') }}" class="site-title">
+ <a href="{{ as_url(routes.root.index) }}" class="site-title">
<h1>
<span class="apache">A<span class="rest">pache</span></span>
<br />
@@ -63,7 +63,7 @@
<ul>
<li>
<i class="fa-solid fa-house"></i>
- <a href="{{ url_for('root') }}"
+ <a href="{{ as_url(routes.root.index) }}"
{% if request.endpoint == 'root' %}class="active"{% endif
%}>About</a>
</li>
<li>
diff --git a/atr/templates/notfound.html b/atr/templates/notfound.html
index 5b3f925..f559638 100644
--- a/atr/templates/notfound.html
+++ b/atr/templates/notfound.html
@@ -25,7 +25,7 @@
</div>
<div class="mt-4">
- <a href="{{ url_for('root') }}" class="btn btn-primary">Return to
Home</a>
+ <a href="{{ as_url(routes.root.index) }}" class="btn btn-primary">Return
to Home</a>
</div>
</div>
{% endblock content %}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]