{# ================================================================================ Empty State Partial (DRY) ================================================================================ Reusable empty-state component for 404, search no-results, blog no-posts, docs nav empty, autodoc empty. Parameters adapt behavior. Usage: {% from "partials/empty-state.html" import empty_state %} {{ empty_state( title="Page Not Found", message="The page you're looking for doesn't exist.", icon="compass", code="404", actions=[{'href': '/', 'label': 'Go Home', 'icon': 'house'}], suggestions=[{'href': '/docs/', 'name': 'Docs'}], show_search_hint=true ) }} Params: - title, message: Required - icon_name: Icon name (default: inbox) - avoid 'icon' to not shadow global - code: Optional large code (e.g. "404") - actions: List of {href, label, icon?} - suggestions: List of {href, name} for nav links - show_search_hint: bool ================================================================================ #} {% def empty_state(title, message, icon_name='inbox', code=none, actions=none, suggestions=none, show_search_hint=false) %}
{% if code %}
{{ code }}
{% end %}

{{ title }}

{{ message }}

{% if actions and actions | length > 0 %}
{% for a in actions %} {% if a.icon %}{{ icon(a.icon, size=16) }}{% end %} {{ a.label }} {% end %}
{% end %} {% if suggestions and suggestions | length > 0 %}

Quick Navigation

{% end %} {% if show_search_hint %}

Press K to search

{% end %}
{% end %}