Files
FixIt/layouts/_partials/plugin/fixit-encryptor.html
T
Cell a5f362f5ff 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
2026-06-25 12:49:17 +08:00

42 lines
1.9 KiB
HTML

{{- /*
Encrypted content renderer.
- Encrypts content payload and renders decryptor UI.
- Supports full-page mode and partial mode with isolated target container.
@param {String} .Password encryption password
@param {String} .Content content to encrypt and render
@param {String} [.Message] custom input placeholder message
@param {Boolean} [.IsPartial] whether current render is partial mode
@param {Object} [.Page] current page context (required when IsPartial is true)
*/ -}}
{{- if .Password -}}
{{- /* Content Encryption */ -}}
{{- $content := dict "Content" .Content "Password" .Password | partial "function/content-encryption.html" -}}
{{- /* Generating fixit-encryptor DOM */ -}}
{{- $message := .Message | default (T "single.encryptedMessage") -}}
{{- $loading := resources.Get "images/loading.svg" | minify -}}
{{- $id := "fixit-decryptor-input" -}}
{{- if .IsPartial -}}
{{- $id = dict "Page" .Page | partial "function/id.html" -}}
{{- end -}}
<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` }}">
<input type="password" id="{{ $id }}" class="fixit-decryptor-input" placeholder="🔑 {{ $message }}" />
</label>
<button class="fixit-decryptor-btn">
{{- dict "Class" "fa-solid fa-unlock" | partial "plugin/icon.html" }}{{ T "single.enterBtn" -}}
</button>
{{- if not .IsPartial -}}
<button class="fixit-encryptor-btn">
{{- dict "Class" "fa-solid fa-lock" | partial "plugin/icon.html" }}{{ T "single.encryptyAgain" -}}
</button>
{{- end -}}
</div>
{{- if .IsPartial }}<div class="decryptor-content"></div>{{ end -}}
<cipher-text data-password="{{ xxhash .Password }}">{{ $content }}</cipher-text>
</fixit-encryptor>
{{- end -}}