Files
docmd-io--docmd/packages/ui/templates/partials/options-menu.ejs
T
wehub-resource-sync 6db8fca185
docmd CI verification / verify (push) Failing after 0s
chore: import upstream snapshot with attribution
2026-07-13 12:31:55 +08:00

42 lines
2.1 KiB
Plaintext

<%# ---------------------------------------------------------------
# docmd : the zero-config documentation engine.
# @website https://docmd.io
# [docmd-source] - Please do not remove this header.
# ---------------------------------------------------------------
%>
<% if (optionsMenu && optionsMenu.components) { %>
<div class="docmd-options-menu">
<% if (optionsMenu.components.search !== false) { %>
<button class="docmd-search-trigger" aria-label="<%= typeof t === 'function' ? t('search') : 'Search' %>">
<%- renderIcon('search') %>
<span class="search-label"><%= typeof t === 'function' ? t('search') : 'Search' %></span>
<span class="search-keys"><kbd class="docmd-kbd">⌘</kbd><kbd class="docmd-kbd">K</kbd></span>
</button>
<% } %>
<% if (locals.workspace && workspace.switcher.enabled && workspace.switcher.position === 'options-menu') { %>
<div class="options-menu-project-switcher">
<%- await include('project-switcher', { workspace, config, renderIcon, compact: true }) %>
</div>
<% } %>
<% if (locals.allLocales && allLocales && allLocales.length > 1 && locals.config && config.i18n && config.i18n.position === 'options-menu') { %>
<div class="options-menu-language">
<%- await include('language-switcher', { allLocales, activeLocale: locals.activeLocale, defaultLocale: locals.defaultLocale, config, renderIcon, compact: true, currentPagePath: locals.currentPagePath, localePrefix: locals.localePrefix }) %>
</div>
<% } %>
<% if (optionsMenu.components.themeSwitch !== false) { %>
<button class="theme-toggle-button" aria-label="<%= typeof t === 'function' ? t('toggleTheme') : 'Toggle theme' %>">
<%- renderIcon('sun', { class: 'icon-sun' }) %> <%- renderIcon('moon', { class: 'icon-moon' }) %>
</button>
<% } %>
<% if (optionsMenu.components.sponsor) { %>
<a href="<%= optionsMenu.components.sponsor %>" target="_blank" rel="noopener noreferrer" class="sponsor-link-button" aria-label="<%= typeof t === 'function' ? t('sponsor') : 'Sponsor' %>">
<%- renderIcon('heart', { class: 'sponsor-icon' }) %>
</a>
<% } %>
</div>
<% } %>