Serve the home nav link from PocketBase, not a hard-coded copy
This commit is contained in:
1 parent
1bdb026669
commit
3fd4068762
8 files changed
+26
-40
No files matched your search
@@ -20,10 +20,10 @@
|
||||
</label>
|
||||
|
||||
<nav class="main-nav">
|
||||
@* A home link that only shows in the collapsed mobile menu. On wide
|
||||
screens the brand is the home link, so this would be a redundant
|
||||
entry -- CSS hides it there (see .nav-home-mobile). *@
|
||||
<NavLink class="nav-home-mobile" href="/" Match="NavLinkMatch.All">Start</NavLink>
|
||||
@* The home link comes from PocketBase like every other entry (the
|
||||
"home" page carries location "header"), so it is rendered by the
|
||||
loop below -- no separate hard-coded home link, which would show
|
||||
up twice next to the PocketBase one. *@
|
||||
@foreach (var link in _header)
|
||||
{
|
||||
<NavLink href="@link.Href" Match="@(link.Href == "/" ? NavLinkMatch.All : NavLinkMatch.Prefix)">@link.Title</NavLink>
|
||||
|
||||
@@ -60,12 +60,10 @@
|
||||
gap: 0.25rem 1.25rem;
|
||||
}
|
||||
|
||||
/* The hamburger button, its state checkbox, and the mobile-only home link are
|
||||
hidden on wide screens; the media query below turns them on for narrow ones.
|
||||
(On wide screens the brand is the home link, so a "Start" entry is redundant.) */
|
||||
/* The hamburger button and its state checkbox are hidden on wide screens; the
|
||||
media query below turns them on for narrow ones. */
|
||||
.nav-toggle,
|
||||
.nav-toggle-label,
|
||||
.nav-home-mobile {
|
||||
.nav-toggle-label {
|
||||
display: none;
|
||||
}
|
||||
|
||||
@@ -177,11 +175,6 @@
|
||||
margin-top: 0.5rem;
|
||||
}
|
||||
|
||||
/* The mobile-only home link reappears as the first entry in the menu. */
|
||||
.nav-home-mobile {
|
||||
display: block;
|
||||
}
|
||||
|
||||
/* Mobile per-link spacing/separators for .main-nav a are in the global app.css
|
||||
too, for the same scoped-attribute reason as above. */
|
||||
}
|
||||
@@ -3,9 +3,9 @@ using Elternbeirat.Contracts;
|
||||
namespace Elternbeirat.Web.Features.Layout;
|
||||
|
||||
/// <summary>
|
||||
/// Builds the header and footer navigation from the public pages. Pages carry a
|
||||
/// <see cref="Page.Location"/> ("header"/"footer"/"") and an <see cref="Page.Order"/>;
|
||||
/// pages without a location are sub-pages and never appear in a menu.
|
||||
/// Builds the header and footer navigation from the public pages. Every page
|
||||
/// carries a required <see cref="Page.Location"/> ("header" or "footer") and an
|
||||
/// <see cref="Page.Order"/>; this splits them into the two menus, each ordered.
|
||||
/// </summary>
|
||||
public static class NavBuilder
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user