docs: add some comments on useful locations
This commit is contained in:
parent
1a907fa9d7
commit
1310f4fc29
@ -16,5 +16,6 @@ pub fn get_router(assets_path: &Path) -> axum::Router {
|
|||||||
.nest_service("/assets", ServeDir::new(assets_path))
|
.nest_service("/assets", ServeDir::new(assets_path))
|
||||||
.merge(pages::get_routes())
|
.merge(pages::get_routes())
|
||||||
.fallback(fallback)
|
.fallback(fallback)
|
||||||
|
// The AutoVaryLayer is used to avoid cache issues with htmx (cf: https://github.com/robertwayne/axum-htmx?tab=readme-ov-file#auto-caching-management)
|
||||||
.layer(AutoVaryLayer)
|
.layer(AutoVaryLayer)
|
||||||
}
|
}
|
||||||
|
@ -4,6 +4,9 @@ pub struct MenuItem {
|
|||||||
pub href: String,
|
pub href: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Get the menu items
|
||||||
|
/// This function is the central place to define the menu items
|
||||||
|
/// It can be used directly in templates, for example in the `navbar` component to render the menu
|
||||||
pub fn get_menu_items() -> Vec<MenuItem> {
|
pub fn get_menu_items() -> Vec<MenuItem> {
|
||||||
vec![
|
vec![
|
||||||
MenuItem {
|
MenuItem {
|
||||||
|
Loading…
Reference in New Issue
Block a user