mirror of
https://github.com/hugo-fixit/FixIt.git
synced 2026-08-24 15:28:57 +00:00
a5f362f5ff
* 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
43 lines
1.6 KiB
HTML
43 lines
1.6 KiB
HTML
{{- define "title" -}}
|
|
{{- cond (.Param "capitalizeTitles") (title .Title) .Title -}}
|
|
{{- if .Site.Params.withSiteTitle }} {{ .Site.Params.titleDelimiter }} {{ .Site.Title }}{{- end -}}
|
|
{{- end -}}
|
|
|
|
{{- define "content" -}}
|
|
{{- $params := partial "function/params.html" -}}
|
|
{{- $cse := .Site.Params.cse -}}
|
|
<article class="page single special search">
|
|
<div class="header">
|
|
{{- /* Title */ -}}
|
|
<h1 class="single-title animate__animated animate__pulse animate__faster">{{- cond (.Param "capitalizeTitles") (title .Title) .Title -}}</h1>
|
|
|
|
{{- /* Subtitle */ -}}
|
|
{{- with $params.subtitle -}}<p class="single-subtitle animate__animated animate__fadeIn">{{ . | $.RenderString }}</p>{{- end -}}
|
|
</div>
|
|
|
|
{{- /* Content */ -}}
|
|
<div class="content" id="content">
|
|
{{- dict "Content" .Content "Ruby" $params.ruby "Fraction" $params.fraction "Fontawesome" $params.fontawesome | partial "function/content.html" | safeHTML -}}
|
|
</div>
|
|
|
|
{{- /* Google CSE */ -}}
|
|
{{- if eq $cse.engine "google" -}}
|
|
{{- with $cse.google.cx -}}
|
|
<script async defer src="https://cse.google.com/cse.js?cx={{ . }}"></script>
|
|
<div class="gcse-searchbox"></div>
|
|
<div class="gcse-searchresults"></div>
|
|
{{- end -}}
|
|
{{- end -}}
|
|
|
|
{{- /* Bing CSE */ -}}
|
|
{{- if eq $cse.engine "bing" -}}
|
|
{{- with $cse.bing.cx -}}
|
|
<script type="text/javascript"
|
|
id="bcs_js_snippet"
|
|
src="https://ui.customsearch.ai/api/ux/rendering-js?customConfig={{ . }}&market=en-US&safeSearch=Moderate&version=latest&q=">
|
|
</script>
|
|
{{- end -}}
|
|
{{- end -}}
|
|
</article>
|
|
{{- end -}}
|