Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

opensearch 支持 #14

Closed
bGZo opened this issue Oct 9, 2024 · 3 comments
Closed

opensearch 支持 #14

bGZo opened this issue Oct 9, 2024 · 3 comments

Comments

@bGZo
Copy link
Contributor

bGZo commented Oct 9, 2024

https://search.luxirty.com 无法被 Firefox 搜索引擎捕捉

图片

原因是没有添加 opensearch 文件,你可能见过 FF 这样的提示:

图片

可能的解决措施

  1. 动态捕获当前域名,自动生成opensearch 文件;
  2. 直接为 https://search.luxirty.com 生成 opensearch 文件;

第 1 种方式时,我发现没有办法用相对路径指定URL

<Url type="text/html" method="get" template="/search?q={searchTerms}&amp;ref=opensearch"/>

所以,需要通过配置 Vue / Vercel 环境变量来动态填充,但在首次部署 Vercel 时,依然获得具体的域名来动态生成 opensearch 文件,仍然需要手动部署一次。

考虑当前项目还未引入 vercel 等环境变量,加上我也不太熟悉这块,所以想暂时用第 2 种方式为网站补充了 opensearch 文件。

Note

但是需要注意,如果是自托管 / 自部署,则需要修改 opensearch.xml 中的根域名,以保证最后添加到 FF 的搜索引擎的正确性。

  1. PR 见 firefox opensearch 支持 #13
  2. 文档见 https://developer.mozilla.org/en-US/docs/Web/OpenSearch
@KoriIku
Copy link
Owner

KoriIku commented Oct 9, 2024

已合并,感谢 PR~

@KoriIku KoriIku closed this as completed Oct 9, 2024
@KoriIku KoriIku reopened this Oct 9, 2024
@KoriIku
Copy link
Owner

KoriIku commented Oct 9, 2024

啊,还需要在 Readme 中的 selfhost 部分添加相应提示,所以暂时保留一下以免我忘记。

@KoriIku
Copy link
Owner

KoriIku commented Oct 10, 2024

已在 readme 添加相关提示。

@KoriIku KoriIku closed this as completed Oct 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants