[skipci]Revert docs changes to fix search

docs: remove committed translation files, keep search freeze fix only
This commit is contained in:
Anon 2026-06-03 12:07:47 +02:00 committed by GitHub
commit de7af06d11
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -16,25 +16,6 @@ import { mainConfig, defaultThemeConfig } from './configs/locales_config.js'
const isProd = process.env.NODE_ENV === 'production'
const htmlEntityMap: Record<string, string> = {
'&amp;': '&',
'&lt;': '<',
'&gt;': '>',
'&quot;': '"',
'&#39;': "'",
'&nbsp;': ' ',
}
function normalizeSearchText(text: string): string {
return text
.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi, ' ')
.replace(/<style\b[^<]*(?:(?!<\/style>)<[^<]*)*<\/style>/gi, ' ')
.replace(/<[^>]+>/g, ' ')
.replace(/&(amp|lt|gt|quot|#39|nbsp);/g, (match) => htmlEntityMap[match] ?? ' ')
.replace(/\s+/g, ' ')
.trim()
}
function vueTemplateTolerantPlugin(): Plugin {
let compilerSfc: typeof import('@vue/compiler-sfc') | undefined
return {
@ -173,10 +154,6 @@ export default defineUserConfig({
searchPlugin({
maxSuggestions: 15,
hotKeys: ['s', '/'],
getExtraFields: (page) => {
const content = normalizeSearchText(page.contentRendered)
return content ? [content] : []
},
locales: {
'/': {
placeholder: 'Search',