New pages: - Home: Redesigned with hero, impact stats, featured project - About: 6-section professional narrative - Projects: Hub with 4 project cards and status badges - Resume: Inline display with download placeholders - Contact: Form UI (disabled) with contact info - Blog: Markdown-based system with frontmatter support Infrastructure: - Blog system with markdown loader (python-frontmatter, markdown, pygments) - Sidebar callback for active state highlighting on navigation - Separated navigation into main pages and projects/dashboards groups Closes #36, #37, #38, #39, #40, #41, #42, #43 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
26 lines
699 B
Python
26 lines
699 B
Python
"""Sidebar navigation callbacks for active state updates."""
|
|
|
|
from typing import Any
|
|
|
|
from dash import Input, Output, callback
|
|
|
|
from portfolio_app.components.sidebar import create_sidebar_content
|
|
|
|
|
|
@callback( # type: ignore[misc]
|
|
Output("floating-sidebar", "children"),
|
|
Input("url", "pathname"),
|
|
prevent_initial_call=False,
|
|
)
|
|
def update_sidebar_active_state(pathname: str) -> list[Any]:
|
|
"""Update sidebar to highlight the current page.
|
|
|
|
Args:
|
|
pathname: Current URL pathname from dcc.Location.
|
|
|
|
Returns:
|
|
Updated sidebar content with correct active state.
|
|
"""
|
|
current_path = pathname or "/"
|
|
return create_sidebar_content(current_path=current_path)
|