mirror of
https://github.com/hugo-fixit/FixIt.git
synced 2026-08-24 15:28:57 +00:00
feat(assets): search UI redesign with heading, metadata and Bing CSE support (#791)
* feat(assets): redesign search result UI with heading, tags, categories and collections - Add heading/anchor display for anchorified search results (inline in title row) - Add tags, categories, collections display in search result metadata row - Extend SearchResult interface with optional heading, tags, categories, collections - Pass metadata through all search engines (Fuse.js, Algolia, Pagefind) - Add search-specific render hooks to eliminate replaceRE hacks: - render-heading.search.json: clean heading output without class/span - render-codeblock.search.json: code output without line numbers - fixit-encryptor.search.json: skip encrypted content in search index - Add data-pagefind-ignore="all" to fixit-encryptor for Pagefind exclusion - Add data-pagefind-meta for tags, categories, collections in Pagefind - Add data-pagefind-sort for title (alphabetical sorting) - Extend PagefindConfig.sortBy to support "title" option - Redesign search modal SCSS with flex layout for title/heading/date row - Add .suggestion-meta row with icon-styled tags/categories/collections * feat(layouts): add Bing Custom Search Engine support - Implement Bing CSE adapter in search engine (redirect to results page) - Add Bing CSE widget embed in search page template via JavaScript snippet - Update CSE engine warning message to be provider-agnostic - Add Bing icon (fa-microsoft) for Bing CSE results - Add cx config field for Bing and mark as unverified
This commit is contained in:
@@ -20,7 +20,7 @@
|
||||
{{- if .IsPartial -}}
|
||||
{{- $id = dict "Page" .Page | partial "function/id.html" -}}
|
||||
{{- end -}}
|
||||
<fixit-encryptor>
|
||||
<fixit-encryptor data-pagefind-ignore="all">
|
||||
<div class="fixit-decryptor-container">
|
||||
<img class="fixit-decryptor-loading" src="{{ $loading.RelPermalink }}" alt="decryptor loading" width="48" height="48" />
|
||||
<label for="{{ $id }}" title="{{ T `single.password` }}">
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
{{- . | safeHTML -}}
|
||||
{{- end -}}
|
||||
{{- if
|
||||
$externalIcon
|
||||
$externalIcon
|
||||
| and $isExternal
|
||||
| and (not (hasPrefix $ctx.Content `<img`))
|
||||
| and (not (hasPrefix $ctx.Content `<svg`))
|
||||
@@ -58,9 +58,9 @@
|
||||
{{- $cardIcon = .RelPermalink -}}
|
||||
{{- end -}}
|
||||
{{- if (not $cardIcon) | and $url.Host -}}
|
||||
{{- with partial "function/get-remote-image.html" (dict "Src" (add "https://favicon.im/" $url.Host)) -}}
|
||||
{{- with partial "function/get-remote-image.html" (dict "Src" (add "https://api.lruihao.cn/google/s2/favicons?sz=64&domain=" $url.Host)) -}}
|
||||
{{- $cardIcon = .RelPermalink -}}
|
||||
{{- else with partial "function/get-remote-image.html" (dict "Src" (add "https://api.lruihao.cn/google/s2/favicons?sz=64&domain=" $url.Host)) -}}
|
||||
{{- else with partial "function/get-remote-image.html" (dict "Src" (add "https://favicon.im/" $url.Host)) -}}
|
||||
{{- $cardIcon = .RelPermalink -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
@@ -6,6 +6,10 @@
|
||||
{{- $dateLabel := $pageDate | dateFormat (.Site.Params.dateFormat | default "2006-01-02") -}}
|
||||
<meta data-pagefind-filter="hidden:{{ $hidden }}">
|
||||
<meta data-pagefind-filter="encrypted:{{ $encrypted }}">
|
||||
<meta data-pagefind-meta="date:{{ $dateLabel }}">
|
||||
<meta data-pagefind-sort="date:{{ $pageDate.Unix }}">
|
||||
<meta data-pagefind-sort="title:{{ .Title }}">
|
||||
<meta data-pagefind-meta="date:{{ $dateLabel }}">
|
||||
{{- with .Params.tags }}<meta data-pagefind-meta="tags:{{ delimit . "," }}">{{ end -}}
|
||||
{{- with .Params.categories }}<meta data-pagefind-meta="categories:{{ delimit . "," }}">{{ end -}}
|
||||
{{- with .Params.collections }}<meta data-pagefind-meta="collections:{{ delimit . "," }}">{{ end -}}
|
||||
{{- end -}}
|
||||
|
||||
Reference in New Issue
Block a user