docs: polish search form

This commit is contained in:
ob-yalian
2026-03-26 16:08:29 +08:00
parent a77d3c78e8
commit b4e5346e52
4 changed files with 669 additions and 19 deletions
+24 -13
View File
@@ -27,24 +27,35 @@
data-no-results="{{ '没有找到匹配结果。' if is_zh else 'No matching results found.' }}"
data-result-one="{{ '找到 1 个匹配结果。' if is_zh else 'Found 1 matching result.' }}"
data-result-many="{{ '找到 {count} 个匹配结果。' if is_zh else 'Found {count} matching results.' }}"
data-history-title="{{ '最近搜索' if is_zh else 'Recent searches' }}"
data-history-empty="{{ '还没有搜索记录。' if is_zh else 'No recent searches yet.' }}"
data-clear-history="{{ '清空历史' if is_zh else 'Clear history' }}"
>
<p>
{{ '支持中文和英文搜索,结果会优先跳转到最接近的章节位置。' if is_zh else 'Supports both Chinese and English search and jumps to the closest matching section.' }}
</p>
<form action="" method="get" role="search">
<input
type="text"
name="q"
aria-labelledby="search-documentation"
value=""
autocomplete="off"
autocorrect="off"
autocapitalize="off"
spellcheck="false"
/>
<input type="submit" value="{{ _('search') }}" />
</form>
<div class="section-search-panel">
<form action="" method="get" role="search" class="section-search-form">
<div class="section-search-form__field">
<span class="section-search-form__icon" aria-hidden="true">⌕</span>
<input
type="text"
name="q"
aria-labelledby="search-documentation"
value=""
placeholder="{{ '输入关键词,例如:相机、sync_mode、网络相机' if is_zh else 'Search keywords like camera, sync_mode, network camera' }}"
autocomplete="off"
autocorrect="off"
autocapitalize="off"
spellcheck="false"
/>
</div>
<button type="submit" class="section-search-form__submit">{{ _('search') }}</button>
</form>
<div id="section-search-history" class="section-search-history" hidden></div>
</div>
<p id="section-search-status" class="search-summary"></p>
<div id="section-search-results"></div>