No results found. Try these popular docs:
' +
+ '' +
'
DevOps 流水线' +
'
Webhook 配置' +
@@ -47,94 +45,40 @@
function removeGuide() {
var guide = document.getElementById(GUIDE_ID);
if (guide) guide.remove();
- if (pollTimer) { clearInterval(pollTimer); pollTimer = null; }
}
- function isVisible(el) {
- if (!el) return false;
- var r = el.getBoundingClientRect();
- return r.width > 0 && r.height > 0;
+ function containsNoResultText(el) {
+ var text = (el.textContent || '').trim();
+ return text.includes('没有结果') || text.includes('No results') || text.includes('未找到');
}
- // 只检查 navbar 搜索区域内,有可见子项才算有结果
- function hasVisibleResults() {
+ function tryEnhance() {
var searchEl = document.querySelector('.navbar__search');
- if (!searchEl) return false;
+ if (!searchEl) return;
+ // 找到搜索插件自带的 listbox(搜索结果容器)
var listbox = searchEl.querySelector('[role="listbox"]');
- if (!listbox || !isVisible(listbox)) return false;
-
- var text = (listbox.textContent || '').trim();
-
- // 明确的无结果提示 → 没有结果
- if (text === '没有结果' || text === '没有结果:' ||
- text === 'No results' || text === '未找到结果') {
- return false;
- }
-
- // 有可见子元素(li/a/按钮/div)→ 有结果
- var children = listbox.children;
- for (var i = 0; i < children.length; i++) {
- if (isVisible(children[i])) return true;
- }
-
- // 没有可见子元素但有一行文字且不是无结果提示 → 可能是有结果
- if (text.length > 0 && !text.startsWith('没有结果') && !text.startsWith('No results')) {
- return true;
- }
-
- return false;
- }
-
- function showGuide() {
- if (document.getElementById(GUIDE_ID)) return;
- var container = document.querySelector('.navbar__search');
- if (!container) return;
- container.appendChild(createGuide());
-
- // 轮询:结果出现时自动清除引导
- if (pollTimer) clearInterval(pollTimer);
- pollTimer = setInterval(function () {
- var input = document.querySelector('.navbar__search input');
- if (!input || input.value.trim().length === 0) {
- removeGuide();
- return;
- }
- if (hasVisibleResults()) {
- removeGuide();
- }
- }, 300);
- }
-
- function checkAndShow() {
- var input = document.querySelector('.navbar__search input');
- if (!input) return;
- if (input.value.trim().length === 0) {
+ if (!listbox || listbox.children.length === 0) {
+ // listbox 还没出现,引导也不需要出现
removeGuide();
return;
}
- // 延迟一小会等搜索渲染完再判断
- setTimeout(function () {
- var curInput = document.querySelector('.navbar__search input');
- if (!curInput || curInput.value.trim().length === 0) {
- removeGuide();
- return;
+ if (containsNoResultText(listbox)) {
+ // 搜索插件显示了「没有结果」→ 追引导内容
+ if (!document.getElementById(GUIDE_ID)) {
+ listbox.appendChild(createGuide());
}
-
- if (!hasVisibleResults()) {
- showGuide();
- } else {
- removeGuide();
- }
- }, 500);
+ } else {
+ // 有结果或其他状态 → 移除引导
+ removeGuide();
+ }
}
function onInput(e) {
if (!e.target.closest('.navbar__search')) return;
- removeGuide();
- clearTimeout(timer);
- timer = setTimeout(checkAndShow, 300);
+ // 等插件渲染完弹窗再判断
+ setTimeout(tryEnhance, 350);
}
function onClickOutside(e) {
@@ -147,6 +91,24 @@
}
function init() {
+ // 监听整个搜索区域的 DOM 变化,插件弹出 listbox 时触发
+ var observer = new MutationObserver(function () {
+ tryEnhance();
+ });
+ var searchEl = document.querySelector('.navbar__search');
+ if (searchEl) {
+ observer.observe(searchEl, { childList: true, subtree: true, characterData: true });
+ }
+
+ // 兜底:首次加载可能还没搜索区域
+ var retry = setInterval(function () {
+ var el = document.querySelector('.navbar__search');
+ if (el) {
+ clearInterval(retry);
+ observer.observe(el, { childList: true, subtree: true, characterData: true });
+ }
+ }, 500);
+
document.addEventListener('input', onInput, true);
document.addEventListener('click', onClickOutside, true);
document.addEventListener('keydown', function (e) {
--
2.34.1
From 44169402e373f5115b458960440ab3edb2f15926 Mon Sep 17 00:00:00 2001
From: ZxR <3193291180@qq.com>
Date: Wed, 13 May 2026 17:30:30 +0800
Subject: [PATCH 41/53] =?UTF-8?q?=E7=AE=80=E5=8C=96=E6=90=9C=E7=B4=A2?=
=?UTF-8?q?=E6=97=A0=E7=BB=93=E6=9E=9C=E5=BC=95=E5=AF=BC=EF=BC=9A=E7=9B=B4?=
=?UTF-8?q?=E6=8E=A5=E6=9F=A5=E6=89=BE=E6=8F=92=E4=BB=B6=E8=87=AA=E5=B8=A6?=
=?UTF-8?q?=E7=9A=84=E6=B2=A1=E6=9C=89=E7=BB=93=E6=9E=9C=E6=96=87=E5=AD=97?=
=?UTF-8?q?=E5=B9=B6=E8=BF=BD=E5=8A=A0=E5=BC=95=E5=AF=BC?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
static/js/search-no-result.js | 64 ++++++++++++++---------------------
1 file changed, 26 insertions(+), 38 deletions(-)
diff --git a/static/js/search-no-result.js b/static/js/search-no-result.js
index 6abd2c0..977db85 100644
--- a/static/js/search-no-result.js
+++ b/static/js/search-no-result.js
@@ -2,6 +2,7 @@
'use strict';
var GUIDE_ID = 'search-no-result-guide';
+ var timer = null;
function getLang() {
return (document.documentElement.lang || 'zh-CN').startsWith('en') ? 'en' : 'zh';
@@ -47,38 +48,43 @@
if (guide) guide.remove();
}
- function containsNoResultText(el) {
- var text = (el.textContent || '').trim();
- return text.includes('没有结果') || text.includes('No results') || text.includes('未找到');
+ function findNoResultLeaf() {
+ var searchEl = document.querySelector('.navbar__search');
+ if (!searchEl) return null;
+
+ // 遍历所有元素,找出内容为「没有结果」的叶子节点
+ var all = searchEl.querySelectorAll('*');
+ for (var i = 0; i < all.length; i++) {
+ var el = all[i];
+ // 只检查叶子元素(没有子元素),避免匹配到整个 listbox
+ if (el.children.length > 0) continue;
+ var text = (el.textContent || '').trim();
+ if (text.startsWith('没有结果') || text.startsWith('No results')) {
+ return el;
+ }
+ }
+ return null;
}
- function tryEnhance() {
- var searchEl = document.querySelector('.navbar__search');
- if (!searchEl) return;
-
- // 找到搜索插件自带的 listbox(搜索结果容器)
- var listbox = searchEl.querySelector('[role="listbox"]');
- if (!listbox || listbox.children.length === 0) {
- // listbox 还没出现,引导也不需要出现
- removeGuide();
- return;
- }
-
- if (containsNoResultText(listbox)) {
- // 搜索插件显示了「没有结果」→ 追引导内容
+ function tryInject() {
+ var noResultEl = findNoResultLeaf();
+ if (noResultEl) {
+ // 找到了搜索插件自带的「没有结果」文字,在它的父容器里追加引导
if (!document.getElementById(GUIDE_ID)) {
- listbox.appendChild(createGuide());
+ var parent = noResultEl.parentElement || noResultEl;
+ parent.appendChild(createGuide());
}
} else {
- // 有结果或其他状态 → 移除引导
removeGuide();
}
}
function onInput(e) {
if (!e.target.closest('.navbar__search')) return;
+ removeGuide();
+ clearTimeout(timer);
// 等插件渲染完弹窗再判断
- setTimeout(tryEnhance, 350);
+ timer = setTimeout(tryInject, 400);
}
function onClickOutside(e) {
@@ -91,24 +97,6 @@
}
function init() {
- // 监听整个搜索区域的 DOM 变化,插件弹出 listbox 时触发
- var observer = new MutationObserver(function () {
- tryEnhance();
- });
- var searchEl = document.querySelector('.navbar__search');
- if (searchEl) {
- observer.observe(searchEl, { childList: true, subtree: true, characterData: true });
- }
-
- // 兜底:首次加载可能还没搜索区域
- var retry = setInterval(function () {
- var el = document.querySelector('.navbar__search');
- if (el) {
- clearInterval(retry);
- observer.observe(el, { childList: true, subtree: true, characterData: true });
- }
- }, 500);
-
document.addEventListener('input', onInput, true);
document.addEventListener('click', onClickOutside, true);
document.addEventListener('keydown', function (e) {
--
2.34.1
From 2b15aa9092c1c6a274452b406979f47241e7097b Mon Sep 17 00:00:00 2001
From: ZxR <3193291180@qq.com>
Date: Wed, 13 May 2026 17:43:36 +0800
Subject: [PATCH 42/53] =?UTF-8?q?=E7=AE=80=E5=8C=96=E6=90=9C=E7=B4=A2?=
=?UTF-8?q?=E7=BB=93=E6=9E=9C=E6=A3=80=E6=B5=8B=EF=BC=9A=E5=8F=AA=E6=9F=A5?=
=?UTF-8?q?listbox=E5=86=85=E6=98=AF=E5=90=A6=E6=9C=89li/a/role=3Doption?=
=?UTF-8?q?=E5=AD=90=E9=A1=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
static/js/search-no-result.js | 66 +++++++++++++++++------------------
1 file changed, 33 insertions(+), 33 deletions(-)
diff --git a/static/js/search-no-result.js b/static/js/search-no-result.js
index 977db85..22ef034 100644
--- a/static/js/search-no-result.js
+++ b/static/js/search-no-result.js
@@ -3,6 +3,7 @@
var GUIDE_ID = 'search-no-result-guide';
var timer = null;
+ var pollTimer = null;
function getLang() {
return (document.documentElement.lang || 'zh-CN').startsWith('en') ? 'en' : 'zh';
@@ -46,54 +47,53 @@
function removeGuide() {
var guide = document.getElementById(GUIDE_ID);
if (guide) guide.remove();
+ if (pollTimer) { clearInterval(pollTimer); pollTimer = null; }
}
- function findNoResultLeaf() {
- var searchEl = document.querySelector('.navbar__search');
- if (!searchEl) return null;
-
- // 遍历所有元素,找出内容为「没有结果」的叶子节点
- var all = searchEl.querySelectorAll('*');
- for (var i = 0; i < all.length; i++) {
- var el = all[i];
- // 只检查叶子元素(没有子元素),避免匹配到整个 listbox
- if (el.children.length > 0) continue;
- var text = (el.textContent || '').trim();
- if (text.startsWith('没有结果') || text.startsWith('No results')) {
- return el;
- }
- }
- return null;
+ function hasResults() {
+ var listbox = document.querySelector('[role="listbox"]');
+ if (!listbox) return false;
+ // 有 li/a/[role=option] 子项才算有搜索结果
+ return listbox.querySelectorAll('li, a, [role="option"]').length > 0;
}
- function tryInject() {
- var noResultEl = findNoResultLeaf();
- if (noResultEl) {
- // 找到了搜索插件自带的「没有结果」文字,在它的父容器里追加引导
- if (!document.getElementById(GUIDE_ID)) {
- var parent = noResultEl.parentElement || noResultEl;
- parent.appendChild(createGuide());
+ function showGuide() {
+ if (document.getElementById(GUIDE_ID)) return;
+ var container = document.querySelector('.navbar__search');
+ if (!container) return;
+ container.appendChild(createGuide());
+
+ if (pollTimer) clearInterval(pollTimer);
+ pollTimer = setInterval(function () {
+ var input = document.querySelector('.navbar__search input');
+ if (!input || input.value.trim().length === 0) { removeGuide(); return; }
+ if (hasResults()) { removeGuide(); }
+ }, 300);
+ }
+
+ function check() {
+ removeGuide();
+ clearTimeout(timer);
+
+ timer = setTimeout(function () {
+ var input = document.querySelector('.navbar__search input');
+ if (!input || input.value.trim().length === 0) return;
+ if (!hasResults()) {
+ showGuide();
}
- } else {
- removeGuide();
- }
+ }, 500);
}
function onInput(e) {
if (!e.target.closest('.navbar__search')) return;
- removeGuide();
- clearTimeout(timer);
- // 等插件渲染完弹窗再判断
- timer = setTimeout(tryInject, 400);
+ check();
}
function onClickOutside(e) {
var guide = document.getElementById(GUIDE_ID);
if (!guide) return;
var searchEl = document.querySelector('.navbar__search');
- if (searchEl && !searchEl.contains(e.target)) {
- removeGuide();
- }
+ if (searchEl && !searchEl.contains(e.target)) { removeGuide(); }
}
function init() {
--
2.34.1
From 332bdeb4226ac723589208429dc25db93c1a67f2 Mon Sep 17 00:00:00 2001
From: ZxR <3193291180@qq.com>
Date: Wed, 13 May 2026 19:31:42 +0800
Subject: [PATCH 43/53] =?UTF-8?q?=E6=98=BE=E7=A4=BA=E5=BC=95=E5=AF=BC?=
=?UTF-8?q?=E6=97=B6=E9=9A=90=E8=97=8F=E6=8F=92=E4=BB=B6=E8=87=AA=E5=B8=A6?=
=?UTF-8?q?=E7=9A=84=E5=8E=9F=E5=A7=8B=E6=97=A0=E7=BB=93=E6=9E=9C=E6=96=87?=
=?UTF-8?q?=E5=AD=97=E9=81=BF=E5=85=8D=E5=86=97=E4=BD=99?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
static/js/search-no-result.js | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/static/js/search-no-result.js b/static/js/search-no-result.js
index 22ef034..d682903 100644
--- a/static/js/search-no-result.js
+++ b/static/js/search-no-result.js
@@ -61,6 +61,15 @@
if (document.getElementById(GUIDE_ID)) return;
var container = document.querySelector('.navbar__search');
if (!container) return;
+
+ // 隐藏插件自带的原始无结果提示
+ var listbox = document.querySelector('[role="listbox"]');
+ if (listbox) {
+ for (var i = 0; i < listbox.children.length; i++) {
+ listbox.children[i].style.display = 'none';
+ }
+ }
+
container.appendChild(createGuide());
if (pollTimer) clearInterval(pollTimer);
--
2.34.1
From 3fbfa98a4896607d95a9974e440045ff0205200c Mon Sep 17 00:00:00 2001
From: ZxR <3193291180@qq.com>
Date: Wed, 13 May 2026 20:15:53 +0800
Subject: [PATCH 44/53] =?UTF-8?q?=E5=B0=86=E6=90=9C=E7=B4=A2=E6=97=A0?=
=?UTF-8?q?=E7=BB=93=E6=9E=9C=E5=BC=95=E5=AF=BC=E9=9B=86=E6=88=90=E5=88=B0?=
=?UTF-8?q?=E6=90=9C=E7=B4=A2=E4=B8=8B=E6=8B=89=E6=A1=86=E5=86=85=E9=83=A8?=
=?UTF-8?q?=E6=9B=BF=E4=BB=A3=E5=8E=9F=E5=A7=8B=E6=97=A0=E7=BB=93=E6=9E=9C?=
=?UTF-8?q?=E6=8F=90=E7=A4=BA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/css/custom.css | 67 +++++++++++------------------------
static/js/search-no-result.js | 13 +++----
2 files changed, 24 insertions(+), 56 deletions(-)
diff --git a/src/css/custom.css b/src/css/custom.css
index 95cc180..84d6405 100644
--- a/src/css/custom.css
+++ b/src/css/custom.css
@@ -154,83 +154,56 @@ html[data-theme='dark'] .docusaurus-highlight-code-line {
opacity: 0;
}
-/* ===== 搜索无结果引导 ===== */
+/* ===== 搜索无结果引导(集成在搜索下拉框内)===== */
.search-no-result-guide {
- margin: 8px 0 4px;
- padding: 14px 16px;
- background: rgba(70, 106, 255, 0.06);
- border-radius: 8px;
- border: 1px solid rgba(70, 106, 255, 0.15);
+ padding: 10px 14px;
}
-html[data-theme='dark'] .search-no-result-guide {
- background: rgba(70, 106, 255, 0.1);
- border-color: rgba(70, 106, 255, 0.2);
-}
-
-.sr-guide-title {
+.search-no-result-guide .sr-guide-title {
font-size: 0.85rem;
font-weight: 600;
- color: #1b2440;
- margin-bottom: 10px;
-}
-
-html[data-theme='dark'] .sr-guide-title {
color: #e3e5e8;
+ margin-bottom: 8px;
}
-.sr-guide-chips {
+.search-no-result-guide .sr-guide-footer {
+ font-size: 0.8rem;
+ color: #9ca3af;
+ margin-top: 8px;
+}
+
+.search-no-result-guide .sr-guide-chips {
display: flex;
flex-wrap: wrap;
gap: 8px;
margin-bottom: 10px;
}
-.sr-guide-chip {
+.search-no-result-guide .sr-guide-chip {
display: inline-block;
padding: 4px 12px;
- border: 1px solid #d1d5db;
+ border: 1px solid #4b5563;
border-radius: 16px;
- color: #374151;
+ color: #d1d5db;
text-decoration: none;
font-size: 0.8rem;
transition: border-color 0.2s, color 0.2s;
- background: #fff;
+ background: rgba(255, 255, 255, 0.06);
}
-.sr-guide-chip:hover {
- border-color: #466aff;
- color: #466aff;
+.search-no-result-guide .sr-guide-chip:hover {
+ border-color: #6b8cff;
+ color: #6b8cff;
text-decoration: none;
}
-html[data-theme='dark'] .sr-guide-chip {
- background: rgba(255, 255, 255, 0.06);
- border-color: #4b5563;
- color: #d1d5db;
-}
-
-html[data-theme='dark'] .sr-guide-chip:hover {
- border-color: #466aff;
+.search-no-result-guide .sr-guide-link {
color: #6b8cff;
-}
-
-.sr-guide-footer {
- font-size: 0.8rem;
- color: #6b7280;
-}
-
-html[data-theme='dark'] .sr-guide-footer {
- color: #9ca3af;
-}
-
-.sr-guide-link {
- color: #466aff;
text-decoration: none;
font-weight: 500;
}
-.sr-guide-link:hover {
+.search-no-result-guide .sr-guide-link:hover {
text-decoration: underline;
}
diff --git a/static/js/search-no-result.js b/static/js/search-no-result.js
index d682903..6f0135f 100644
--- a/static/js/search-no-result.js
+++ b/static/js/search-no-result.js
@@ -59,18 +59,13 @@
function showGuide() {
if (document.getElementById(GUIDE_ID)) return;
- var container = document.querySelector('.navbar__search');
- if (!container) return;
- // 隐藏插件自带的原始无结果提示
+ // 找到搜索插件自带的 listbox,把引导内容替换进去
var listbox = document.querySelector('[role="listbox"]');
- if (listbox) {
- for (var i = 0; i < listbox.children.length; i++) {
- listbox.children[i].style.display = 'none';
- }
- }
+ if (!listbox) return;
- container.appendChild(createGuide());
+ listbox.innerHTML = '';
+ listbox.appendChild(createGuide());
if (pollTimer) clearInterval(pollTimer);
pollTimer = setInterval(function () {
--
2.34.1
From 032e56c794f77f80bc50fc7a5d820d2ddc3de65c Mon Sep 17 00:00:00 2001
From: ZxR <3193291180@qq.com>
Date: Wed, 13 May 2026 20:30:51 +0800
Subject: [PATCH 45/53] =?UTF-8?q?=E4=BF=AE=E5=A4=8DhasResults=E8=AF=AF?=
=?UTF-8?q?=E6=8A=8A=E5=BC=95=E5=AF=BC=E5=86=85=E9=93=BE=E6=8E=A5=E5=BD=93?=
=?UTF-8?q?=E6=88=90=E6=90=9C=E7=B4=A2=E7=BB=93=E6=9E=9C=E5=AF=BC=E8=87=B4?=
=?UTF-8?q?=E9=9D=A2=E6=9D=BF=E8=A2=AB=E6=B8=85=E7=A9=BA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
static/js/search-no-result.js | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/static/js/search-no-result.js b/static/js/search-no-result.js
index 6f0135f..efbc9f2 100644
--- a/static/js/search-no-result.js
+++ b/static/js/search-no-result.js
@@ -53,8 +53,12 @@
function hasResults() {
var listbox = document.querySelector('[role="listbox"]');
if (!listbox) return false;
- // 有 li/a/[role=option] 子项才算有搜索结果
- return listbox.querySelectorAll('li, a, [role="option"]').length > 0;
+ // 检查是否有搜索结果项(排除我们引导里的链接)
+ var items = listbox.querySelectorAll('li, a, [role="option"]');
+ for (var i = 0; i < items.length; i++) {
+ if (!items[i].closest('#' + GUIDE_ID)) return true;
+ }
+ return false;
}
function showGuide() {
--
2.34.1
From 30b4a5dc4450156f53308c28442f15fc11325769 Mon Sep 17 00:00:00 2001
From: ZxR <3193291180@qq.com>
Date: Wed, 13 May 2026 20:53:17 +0800
Subject: [PATCH 46/53] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=90=9C=E7=B4=A2?=
=?UTF-8?q?=E7=BB=93=E6=9E=9C=E6=B6=88=E5=A4=B1=E5=92=8C=E4=BA=8C=E6=AC=A1?=
=?UTF-8?q?=E7=82=B9=E5=87=BB=E7=A9=BA=E6=A1=86=E9=97=AE=E9=A2=98=EF=BC=9A?=
=?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=AE=89=E5=85=A8=E6=A3=80=E6=9F=A5=E3=80=81?=
=?UTF-8?q?=E5=BB=B6=E9=95=BF=E7=AD=89=E5=BE=85=E3=80=81=E6=B7=BB=E5=8A=A0?=
=?UTF-8?q?focus=E4=BA=8B=E4=BB=B6?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
static/js/search-no-result.js | 22 ++++++++++++++++------
1 file changed, 16 insertions(+), 6 deletions(-)
diff --git a/static/js/search-no-result.js b/static/js/search-no-result.js
index efbc9f2..73cddda 100644
--- a/static/js/search-no-result.js
+++ b/static/js/search-no-result.js
@@ -53,10 +53,9 @@
function hasResults() {
var listbox = document.querySelector('[role="listbox"]');
if (!listbox) return false;
- // 检查是否有搜索结果项(排除我们引导里的链接)
- var items = listbox.querySelectorAll('li, a, [role="option"]');
- for (var i = 0; i < items.length; i++) {
- if (!items[i].closest('#' + GUIDE_ID)) return true;
+ var children = listbox.children;
+ for (var i = 0; i < children.length; i++) {
+ if (children[i].id !== GUIDE_ID) return true;
}
return false;
}
@@ -64,10 +63,12 @@
function showGuide() {
if (document.getElementById(GUIDE_ID)) return;
- // 找到搜索插件自带的 listbox,把引导内容替换进去
var listbox = document.querySelector('[role="listbox"]');
if (!listbox) return;
+ // 安全检查:如果此时已经有结果了,不要替换
+ if (hasResults()) return;
+
listbox.innerHTML = '';
listbox.appendChild(createGuide());
@@ -89,7 +90,7 @@
if (!hasResults()) {
showGuide();
}
- }, 500);
+ }, 800);
}
function onInput(e) {
@@ -97,6 +98,14 @@
check();
}
+ // 修复问题2:搜索框已有文字时点击搜索框重新检查
+ function onFocus(e) {
+ if (!e.target.closest('.navbar__search input')) return;
+ if (e.target.value.trim().length > 0) {
+ check();
+ }
+ }
+
function onClickOutside(e) {
var guide = document.getElementById(GUIDE_ID);
if (!guide) return;
@@ -106,6 +115,7 @@
function init() {
document.addEventListener('input', onInput, true);
+ document.addEventListener('focus', onFocus, true);
document.addEventListener('click', onClickOutside, true);
document.addEventListener('keydown', function (e) {
if (e.key === 'Escape') removeGuide();
--
2.34.1
From 03fe6465021a2cf51f0ba20d1b0f9a20e7b5e543 Mon Sep 17 00:00:00 2001
From: ZxR <3193291180@qq.com>
Date: Wed, 13 May 2026 21:12:34 +0800
Subject: [PATCH 47/53] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=97=A0=E7=BB=93?=
=?UTF-8?q?=E6=9E=9C=E5=BC=95=E5=AF=BC=E8=A2=AB=E8=AF=AF=E5=88=A4=E4=B8=BA?=
=?UTF-8?q?=E6=90=9C=E7=B4=A2=E7=BB=93=E6=9E=9C=EF=BC=9A=E6=8E=92=E9=99=A4?=
=?UTF-8?q?=E6=97=A0=E7=BB=93=E6=9E=9C=E6=96=87=E5=AD=97=E5=8C=B9=E9=85=8D?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
static/js/search-no-result.js | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/static/js/search-no-result.js b/static/js/search-no-result.js
index 73cddda..519f11c 100644
--- a/static/js/search-no-result.js
+++ b/static/js/search-no-result.js
@@ -53,11 +53,23 @@
function hasResults() {
var listbox = document.querySelector('[role="listbox"]');
if (!listbox) return false;
+
+ // 检查是否有除了我们引导之外的子元素
+ var hasOtherChildren = false;
var children = listbox.children;
for (var i = 0; i < children.length; i++) {
- if (children[i].id !== GUIDE_ID) return true;
+ if (children[i].id !== GUIDE_ID) { hasOtherChildren = true; break; }
}
- return false;
+ if (!hasOtherChildren) return false;
+
+ // 有子元素,但如果是无结果文字说明仍是无结果状态
+ var text = (listbox.textContent || '').trim();
+ if (text.includes('没有找到') || text.includes('没有结果') ||
+ text.includes('No results') || text.includes('未找到')) {
+ return false;
+ }
+
+ return true;
}
function showGuide() {
--
2.34.1
From 8474892c91837d0874de1ce80ceae3dd7bc5801f Mon Sep 17 00:00:00 2001
From: ZxR <3193291180@qq.com>
Date: Wed, 13 May 2026 21:59:38 +0800
Subject: [PATCH 48/53] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dfocus=E6=97=B6=E8=AF=AF?=
=?UTF-8?q?=E6=9B=BF=E6=8D=A2=E6=90=9C=E7=B4=A2=E7=BB=93=E6=9E=9C=EF=BC=9A?=
=?UTF-8?q?=E6=94=B9=E4=B8=BA=E5=A4=9A=E6=AC=A1=E6=A3=80=E6=9F=A5=E7=AD=89?=
=?UTF-8?q?=E6=8F=92=E4=BB=B6=E6=B8=B2=E6=9F=93=E5=AE=8C=E6=88=90?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
static/js/search-no-result.js | 21 ++++++++++++++++++---
1 file changed, 18 insertions(+), 3 deletions(-)
diff --git a/static/js/search-no-result.js b/static/js/search-no-result.js
index 519f11c..02c0b2e 100644
--- a/static/js/search-no-result.js
+++ b/static/js/search-no-result.js
@@ -110,12 +110,27 @@
check();
}
- // 修复问题2:搜索框已有文字时点击搜索框重新检查
+ // 搜索框已有文字时点击搜索框:反复检查,等插件渲染完再决定
function onFocus(e) {
if (!e.target.closest('.navbar__search input')) return;
- if (e.target.value.trim().length > 0) {
- check();
+ if (e.target.value.trim().length === 0) return;
+
+ var attempts = 0;
+ var maxAttempts = 6;
+
+ function checkFocus() {
+ if (hasResults()) return; // 结果出现了,不用引导
+ var input = document.querySelector('.navbar__search input');
+ if (!input || input.value.trim().length === 0) return;
+ attempts++;
+ if (attempts < maxAttempts) {
+ setTimeout(checkFocus, 300);
+ } else if (!hasResults()) {
+ showGuide();
+ }
}
+
+ setTimeout(checkFocus, 400);
}
function onClickOutside(e) {
--
2.34.1
From d68c7c6d4e38b84890032b04f0331a74022bfd46 Mon Sep 17 00:00:00 2001
From: ZxR <3193291180@qq.com>
Date: Thu, 14 May 2026 15:43:25 +0800
Subject: [PATCH 49/53] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=BA=E6=88=91?=
=?UTF-8?q?=E7=9A=84=E8=B4=A6=E5=8F=B7?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
docs/快速开始/注册GitLink账号.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/快速开始/注册GitLink账号.md b/docs/快速开始/注册GitLink账号.md
index 5b3cadf..4d4e8a8 100644
--- a/docs/快速开始/注册GitLink账号.md
+++ b/docs/快速开始/注册GitLink账号.md
@@ -3,7 +3,7 @@ sidebar_label: '注册GitLink账号'
sidebar_position: 1
---
-# 注册GitLink账号
+# 注册我的GitLink账号
## 1. 点击**立即注册**按钮
--
2.34.1
From 7a73076c0ef98ef341f18f98c754a2b63d115657 Mon Sep 17 00:00:00 2001
From: ZxR <3193291180@qq.com>
Date: Thu, 14 May 2026 16:06:53 +0800
Subject: [PATCH 50/53] =?UTF-8?q?=E5=88=A0=E6=8E=89=E6=88=91=E7=9A=84?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
docs/快速开始/注册GitLink账号.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/快速开始/注册GitLink账号.md b/docs/快速开始/注册GitLink账号.md
index 4d4e8a8..5b3cadf 100644
--- a/docs/快速开始/注册GitLink账号.md
+++ b/docs/快速开始/注册GitLink账号.md
@@ -3,7 +3,7 @@ sidebar_label: '注册GitLink账号'
sidebar_position: 1
---
-# 注册我的GitLink账号
+# 注册GitLink账号
## 1. 点击**立即注册**按钮
--
2.34.1
From 6754c8d7de89cb695a6bf24e920b7cb09be65bdd Mon Sep 17 00:00:00 2001
From: ZxR <3193291180@qq.com>
Date: Thu, 14 May 2026 16:28:50 +0800
Subject: [PATCH 51/53] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E2=80=9C=E6=88=91?=
=?UTF-8?q?=E7=9A=84=E2=80=9D?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
docs/快速开始/创建第一个开源项目.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/快速开始/创建第一个开源项目.md b/docs/快速开始/创建第一个开源项目.md
index b18cc64..78a81a7 100644
--- a/docs/快速开始/创建第一个开源项目.md
+++ b/docs/快速开始/创建第一个开源项目.md
@@ -3,7 +3,7 @@ sidebar_label: '创建第一个开源项目'
sidebar_position: 2
---
-# 创建第一个开源项目
+# 创建我的第一个开源项目
## 1. 新建项目
--
2.34.1
From 6e4b33581653dd3dc3e44597d168d182867d9c89 Mon Sep 17 00:00:00 2001
From: ylly
Date: Thu, 28 May 2026 19:30:21 +0800
Subject: [PATCH 52/53] =?UTF-8?q?feat:=20.devops/gitlink-cli=E8=87=AA?=
=?UTF-8?q?=E5=8A=A8=E9=83=A8=E7=BD=B2.yml?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.devops/gitlink-cli自动部署.yml | 42 +++++++++++++++++++++++++++++
1 file changed, 42 insertions(+)
create mode 100644 .devops/gitlink-cli自动部署.yml
diff --git a/.devops/gitlink-cli自动部署.yml b/.devops/gitlink-cli自动部署.yml
new file mode 100644
index 0000000..8734a27
--- /dev/null
+++ b/.devops/gitlink-cli自动部署.yml
@@ -0,0 +1,42 @@
+ version: 2
+ name: gitlink-cli自动部署
+ description: ""
+ global:
+ concurrent: 1
+ trigger:
+ webhook: gitlink@1.0.0
+ event:
+ - ref: push
+ ruleset-operator: AND
+ workflow:
+ - ref: start
+ name: 开始
+ task: start
+ - ref: git_clone_1
+ name: git clone
+ task: git_clone@1.2.9
+ input:
+ username: ((gitlink_cli.ylly_git_user))
+ password: ((gitlink_cli.ylly_git_pass))
+ remote_url: '"https://gitlink.org.cn/ylly/gitlink-cli.git"'
+ ref: '"refs/heads/master"'
+ commit_id: '""'
+ depth: 1
+ needs:
+ - start
+ - ref: ssh_cmd_1
+ name: ssh执行命令
+ task: ssh_cmd@1.1.1
+ input:
+ ssh_pass: ((gitlink_cli.ecs_ssh_key))
+ ssh_ip: '"8.136.61.14"'
+ ssh_port: '"22"'
+ ssh_user: '"root"'
+ ssh_cmd: '"cd /opt/gitlink-cli && git pull && go build -o /usr/local/bin/gitlink-cli . && gitlink-cli version"'
+ needs:
+ - git_clone_1
+ - ref: end
+ name: 结束
+ task: end
+ needs:
+ - ssh_cmd_1
\ No newline at end of file
--
2.34.1
From ff9172471b8209ca2ecf2a0e9ff2c392816e5af6 Mon Sep 17 00:00:00 2001
From: ylly
Date: Thu, 28 May 2026 19:31:41 +0800
Subject: [PATCH 53/53] =?UTF-8?q?refactor:=20delete=20.devops/gitlink-cli?=
=?UTF-8?q?=E8=87=AA=E5=8A=A8=E9=83=A8=E7=BD=B2.yml?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.devops/gitlink-cli自动部署.yml | 42 -----------------------------
1 file changed, 42 deletions(-)
delete mode 100644 .devops/gitlink-cli自动部署.yml
diff --git a/.devops/gitlink-cli自动部署.yml b/.devops/gitlink-cli自动部署.yml
deleted file mode 100644
index 8734a27..0000000
--- a/.devops/gitlink-cli自动部署.yml
+++ /dev/null
@@ -1,42 +0,0 @@
- version: 2
- name: gitlink-cli自动部署
- description: ""
- global:
- concurrent: 1
- trigger:
- webhook: gitlink@1.0.0
- event:
- - ref: push
- ruleset-operator: AND
- workflow:
- - ref: start
- name: 开始
- task: start
- - ref: git_clone_1
- name: git clone
- task: git_clone@1.2.9
- input:
- username: ((gitlink_cli.ylly_git_user))
- password: ((gitlink_cli.ylly_git_pass))
- remote_url: '"https://gitlink.org.cn/ylly/gitlink-cli.git"'
- ref: '"refs/heads/master"'
- commit_id: '""'
- depth: 1
- needs:
- - start
- - ref: ssh_cmd_1
- name: ssh执行命令
- task: ssh_cmd@1.1.1
- input:
- ssh_pass: ((gitlink_cli.ecs_ssh_key))
- ssh_ip: '"8.136.61.14"'
- ssh_port: '"22"'
- ssh_user: '"root"'
- ssh_cmd: '"cd /opt/gitlink-cli && git pull && go build -o /usr/local/bin/gitlink-cli . && gitlink-cli version"'
- needs:
- - git_clone_1
- - ref: end
- name: 结束
- task: end
- needs:
- - ssh_cmd_1
\ No newline at end of file
--
2.34.1