Closed ghost closed 3 years ago
能提供一下你的网页链接么?
如果用的是这个脚本 https://github.com/next-theme/hexo-theme-next/blob/master/source/js/local-search.js
那么这个 CONFIG 是 NexT 主题的,大概长这样
var CONFIG = {"hostname":"theme-next.js.org","root":"/","images":"/images","scheme":"Gemini","version":"8.2.1","exturl":true,"sidebar":{"position":"left","display":"post","padding":18,"offset":12},"copycode":true,"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":false,"mediumzoom":true,"lazyload":false,"pangu":false,"comments":{"style":"tabs","active":null,"storage":true,"lazyload":true,"nav":null},"motion":{"enable":true,"async":true,"transition":{"post_block":"fadeIn","post_header":"fadeInDown","post_body":"fadeInDown","coll_header":"fadeInLeft","sidebar":"fadeInUp"}},"prism":false,"i18n":{"placeholder":"Searching...","empty":"We didn't find any results for the search: ${query}","hits_time":"${hits} results found in ${time} ms","hits":"${hits} results found"},"path":"/search.json","localsearch":{"enable":true,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false}};
如果是其他主题,可能需要自行修改 local-search.js
才能使用。这个 hexo-generator-searchdb 插件只负责生成搜索的索引,不包含前端脚本。
使用报错