feat: add rss_url to HtmlPageContext, use it in nav

This commit is contained in:
2026-05-04 20:55:31 +02:00
parent 0433cd4d9b
commit cbd2ac5b3e
3 changed files with 5 additions and 1 deletions

View File

@@ -15,7 +15,7 @@
<nav>
<a href="/">Feed</a>
<a href="/users">Users</a>
<a href="/feed.rss">RSS</a>
<a href="{{ ctx.rss_url }}">RSS</a>
{% if let Some(email) = ctx.user_email %}
<a href="/reviews/new">Add Review</a>
<a href="/logout">Logout</a>

View File

@@ -6,6 +6,7 @@ pub struct HtmlPageContext {
pub user_email: Option<String>,
pub user_id: Option<Uuid>,
pub register_enabled: bool,
pub rss_url: String,
}
impl HtmlPageContext {

View File

@@ -41,6 +41,7 @@ pub mod html {
user_email,
user_id: uuid,
register_enabled: state.app_ctx.config.allow_registration,
rss_url: "/feed.rss".to_string(),
}
}
@@ -67,6 +68,7 @@ pub mod html {
user_email: None,
user_id: None,
register_enabled: state.app_ctx.config.allow_registration,
rss_url: "/feed.rss".to_string(),
};
let html = state
.html_renderer
@@ -119,6 +121,7 @@ pub mod html {
user_email: None,
user_id: None,
register_enabled: true,
rss_url: "/feed.rss".to_string(),
};
let html = state
.html_renderer