All Projects → AlanDecode → Typecho Plugin Exsearch

AlanDecode / Typecho Plugin Exsearch

Licence: mit
🔍 为 Typecho 带来实时搜索体验

Labels

Projects that are alternatives of or similar to Typecho Plugin Exsearch

Editormd
Markdown 编辑器 Editor.md for Typecho
Stars: ✭ 389 (+318.28%)
Mutual labels:  typecho
Typecho Theme Twitter
A twitter liked typecho theme.
Stars: ✭ 9 (-90.32%)
Mutual labels:  typecho
Adams
🍢 A simple but graceful typecho theme.
Stars: ✭ 70 (-24.73%)
Mutual labels:  typecho
Onekey caddy php7 sqlite3
小内存 VPS 一键搭建 Caddy+PHP7+Sqlite3 环境 (支持VPS最小内存64M),一键翻墙 caddy+web(php+sqlite3)+v2ray+bbr。
Stars: ✭ 435 (+367.74%)
Mutual labels:  typecho
Pio
🎃 一个支持更换 Live2D 模型的纯 JS 插件
Stars: ✭ 626 (+573.12%)
Mutual labels:  typecho
Material Typecho
🎨 简洁 material 风格 typecho 主题
Stars: ✭ 53 (-43.01%)
Mutual labels:  typecho
Typecho Theme Material
Material Design theme for typecho.
Stars: ✭ 366 (+293.55%)
Mutual labels:  typecho
Pinghsu
Pinghsu, A Typecho Theme
Stars: ✭ 1,258 (+1252.69%)
Mutual labels:  typecho
Typecho Viewscounter
A plugin of typecho for statisticing the visit counts of the posts.
Stars: ✭ 22 (-76.34%)
Mutual labels:  typecho
Typecho Theme Waxy
Waxy 简洁自适应博客主题,轻量高效,悦于书写!演示地址:https://www.idzd.top/
Stars: ✭ 65 (-30.11%)
Mutual labels:  typecho
Single
🎈 一个简洁大气,含夜间模式的 Typecho 博客主题
Stars: ✭ 439 (+372.04%)
Mutual labels:  typecho
Typecho Theme Void
🐒 猴子打字机原理的产物
Stars: ✭ 541 (+481.72%)
Mutual labels:  typecho
Typecho Plugin Mailer
📧 又一款评论邮件提醒插件
Stars: ✭ 60 (-35.48%)
Mutual labels:  typecho
Typecho Theme Aria
Typecho Theme Aria - 书写自己的篇章
Stars: ✭ 422 (+353.76%)
Mutual labels:  typecho
Cat
a slight blog theme.
Stars: ✭ 75 (-19.35%)
Mutual labels:  typecho
Aplayer Typecho
在线音乐播放器插件 for typecho 1.0
Stars: ✭ 381 (+309.68%)
Mutual labels:  typecho
Typecho
A PHP Blogging Platform. Simple and Powerful.
Stars: ✭ 8,417 (+8950.54%)
Mutual labels:  typecho
Teepay
Typecho 个人支付宝、微信收款插件
Stars: ✭ 90 (-3.23%)
Mutual labels:  typecho
Copyright For Typecho
一个灵活的版权小尾巴插件 for Typecho
Stars: ✭ 80 (-13.98%)
Mutual labels:  typecho
Dreamcat
DreamCat 是一个极简自适应博客主题,年轻人追梦良品!
Stars: ✭ 62 (-33.33%)
Mutual labels:  typecho

Typecho-Plugin-ExSearch

🔍 为 Typecho 带来实时搜索体验 build status

使用

  • 下载本仓库(master 分支):下载
  • 解压文件夹,并将文件夹重命名为 ExSearch
  • 上传至插件目录,在后台启用
  • 保存一次插件设置,并点击重建索引。

在主题中,在任何可点击的元素上加上 class="search-form-input",点击即可唤起搜索框。

自定义 hook

默认的,点击搜索结果时会直接跳转至对应的页面,但是若你的主题使用了 AJAX 或者 PJAX 技术,你可能需要使用自定义的钩子来处理点击事件(例如发起一次 PJAX 操作)。在页面中插入一个函数如下:

<script>
function ExSearchCall(item){
    // your code
}
</script>

其中,item 是一个 JQuery 对象。举例:

function ExSearchCall(item){
    if (item && item.length) {
        $('.ins-close').click(); // 关闭搜索框
        let url = item.attr('data-url'); // 获取目标页面 URL
        $.pjax({url: url, 
            container: '#pjax-container',
            fragment: '#pjax-container',
            timeout: 8000, }); // 发起一次 PJAX 请求
    }
}

可能的问题

如果你的站点内容过多导致建立索引失败,请在 Plugin.php 第 136 行左右的位置,取消下面两行的注释:

$sql = 'SET GLOBAL max_allowed_packet=4294967295;';
$db->query($sql);

注意,这需要高级权限。你也可以手动对数据库执行:

mysql > SET GLOBAL max_allowed_packet=4294967295;

Credit

本项目灵感来源于 WikittenPPOffice,感谢。

This project is inspired by Wikitten and PPOffice, thanks.

捐助

如果这个项目有帮助到你,请考虑向我捐助:

LICENSE

MIT.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].