feat: add Jinja2 server-side rendering with template components and locust load testing
Introduce a full server-side rendering pipeline using Jinja2Templates, including base layout, navigation, modals, and rant card components. Add a classic.html static fallback page and a locustfile.py for load testing the new endpoints. Update main.py to mount static files, create template directories on startup, and add a format_time helper for relative timestamps.
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
<nav>
|
||||
<div class="nav-container">
|
||||
<a href="/" class="logo">Rant</a>
|
||||
<div class="nav-links">
|
||||
<a href="/">Feed</a>
|
||||
<a href="/search">Search</a>
|
||||
{% if current_user %}
|
||||
<span>
|
||||
<a href="/profile/{{ current_user.id }}">Profile</a>
|
||||
<a href="/notifications">Notifications {% if notif_count > 0 %}<span style="color: var(--error);">({{ notif_count }})</span>{% endif %}</a>
|
||||
</span>
|
||||
<span>
|
||||
<a href="/logout" class="btn btn-secondary">Logout</a>
|
||||
</span>
|
||||
{% else %}
|
||||
<span>
|
||||
<button class="btn btn-secondary" onclick="showModal('login')">Login</button>
|
||||
<button class="btn" onclick="showModal('register')">Sign Up</button>
|
||||
</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
Reference in New Issue
Block a user