{# Dev server: vars unset -> absolute paths + live API. Static build: root-relative paths resolved against a runtime . #} {% set ap = asset_prefix | default("/") %} {% set home = home_href | default("/") %} {# Desktop sidebar collapse. `sidebar_collapsed` is the first-visit default (a saved localStorage choice overrides it); `sidebar_can_toggle` gates the control. Defaults keep older render callers working. #} {% set sidebar_collapsed_default = 'true' if (sidebar_collapsed | default(false)) else 'false' %} {% set sidebar_can_toggle = sidebar_toggle | default(true) %} {# A single-page project hides the nav + menu buttons entirely (nothing to navigate to) unless sidebar.show_single_page forces them on. #} {% set sidebar_shown = show_sidebar | default(true) %} {# "Made with Dashdown" attribution footer (rendered into
below). Single source of truth for the link — swap for the product site once it exists. #} {% set made_with_url = "https://github.com/DirendAI/dashdown" %} {# Full-text search box. Rendered into the header (centered, desktop) and the top of the mobile menu — see the .dashdown-header-search / .dashdown-sidebar-search wrappers below. site_search.js finds it by the data-async-component selector and fetches the index client-side. #} {% macro site_search(placeholder, max_results) -%} {%- endmacro %} {# Static build only: compute the absolute site root from this page's depth and set so every relative URL resolves correctly no matter how the page is served (trailing slash or not, sub-path, etc.). Must run before any / {%- for css in (component_css | default([])) %} {%- endfor %} {%- if custom_css_url %} {%- endif %} {%- if component_js %} {%- set importmap_base = ap if ap else "./" %} {%- endif %} {# Embed mode (?_embed): the app shell — header, sidebar, breadcrumbs — is omitted so a page can be