add nav editors to Site tab with live preview
All checks were successful
deploy / deploy (push) Successful in 3m27s

- Add header and footer nav editors to Site tab with drag-to-reorder,
  add/remove items, and destination picker (pages, collections, external)
- Live preview updates as you edit nav items
- Remove legacy /admin/navigation page and controller (was saving to
  Settings table, now uses nav_items table)
- Update error_html.ex and pages/editor.ex to load nav from nav_items table
- Update link_scanner to read from nav_items table, edit path now /?edit=site
- Add Site.default_header_nav/0 and default_footer_nav/0 for previews/errors
- Remove fallback logic from theme_hook.ex (database is now source of truth)
- Seed default nav items and social links during setup

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
jamey
2026-03-28 22:19:48 +00:00
parent 5a5103bc42
commit 7c07805df8
24 changed files with 1068 additions and 1130 deletions

View File

@@ -3295,21 +3295,47 @@
.site-editor-nav-item {
display: flex;
justify-content: space-between;
align-items: center;
padding: 0.5rem 0.75rem;
gap: 0.5rem;
align-items: flex-start;
padding: 0.5rem;
background: var(--t-surface-sunken);
border-radius: 0.375rem;
font-size: 0.8125rem;
}
.site-editor-nav-label {
.site-editor-nav-item-form {
display: flex;
flex-direction: column;
gap: 0.375rem;
flex: 1;
min-width: 0;
}
.site-editor-nav-label-input {
font-weight: 500;
}
.site-editor-nav-url {
font-size: 0.75rem;
opacity: 0.6;
.site-editor-nav-url-row {
display: flex;
gap: 0.375rem;
}
.site-editor-nav-type {
width: 6rem;
flex-shrink: 0;
}
.site-editor-nav-page,
.site-editor-nav-url-input {
flex: 1;
min-width: 0;
}
.site-editor-nav-item-actions {
display: flex;
gap: 0.125rem;
flex-shrink: 0;
padding-top: 0.25rem;
}
/* Social links editor item */