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

Algolia站内搜索没有显示 #306

Closed
lzwgiter opened this issue Aug 7, 2021 · 9 comments
Closed

Algolia站内搜索没有显示 #306

lzwgiter opened this issue Aug 7, 2021 · 9 comments

Comments

@lzwgiter
Copy link

lzwgiter commented Aug 7, 2021

「描述遇到的问题」或「发现的 bug」(Describe the problem or bug you encounter)
最新版本Archer主题,博客根目录下_config.yml已填写algolia api key等信息,并通过了hexo aloglia确保无误,主题_config.yml也开启了aloglia选项,但是网页上并没有看到站内搜索栏
你是否已经阅读过以下内容,并确认你的行为是正确的,在 [ ] 中填入 x 选中(Ensure that you had consulted followings and confirm the validity of your operation, fill x in [ ] to select)

如何复现(To Reproduce)

存在问题或 bug 的已部署上线的页面地址(A deployed page link that with bug or problem)
已部署的网页:https://float311.gitee.io/

如果可能是与 markdown 内容相关的问题或 bug,请粘贴对应的 markdown 内容(If the problem or bug that may be related to markdown, paste it here)

打开控制台,填写控制台中打印的主题的版本,如果脚本出错可直接提供控制台截图(Open the console and report the version of hexo-theme-archer. You can paste the screenshot on console directly if there is error with script)

  • hexo: 5.4.0
  • archer: 1.6.3

信息 (please complete the following information):

  • 操作系统(OS): windows 10
  • 浏览器(Browser)Edge
  • 浏览器版本(Version)[e.g. 22][可选]

其他信息(Additional context)

@LolipopJ
Copy link
Collaborator

LolipopJ commented Aug 7, 2021

目前版本的 Algolia 搜索按钮在侧边栏中。

考虑到使用上的便利性,未来可能会放置到 <header /> 处。

@LolipopJ LolipopJ closed this as completed Aug 7, 2021
@LolipopJ LolipopJ reopened this Aug 7, 2021
@lzwgiter
Copy link
Author

lzwgiter commented Aug 7, 2021 via email

@LolipopJ
Copy link
Collaborator

LolipopJ commented Aug 7, 2021

注意到您博客打印了 console 如下:

jquery.min.js:2 Uncaught ReferenceError: algolia is not defined
    at HTMLDocument.<anonymous> (search.js:15)
    at e (jquery.min.js:2)
    at t (jquery.min.js:2)

但是在网页的源文件里又顺利渲染出了:

<script>
  var hits = JSON.parse('{"per_page":10}')
  var labels = JSON.parse('{"input_placeholder":"Search for Posts","hits_empty":"We did not find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}')

  var algolia = {
    applicationID: '99K726IL0C',
    apiKey: '3afc6cf29d67683d23d7b0faccb5c7ab',
    indexName: 'float's blog',
    hits: hits,
    labels: labels
  }
</script>

我不确定是哪一个地方出了错误。测试我的博客在 Edge 和 Chrome 浏览器能顺利显示 Algolia 搜索功能。


您好!我archer老粉,今天刚刚换了最新1.6.3的版本,然后发现在本地生成的时候hexo -g,会出现打印很多行SEO_Keywords的情况,如果我没有写这些Keywords的话则会打印很多空白行。问题图如下,但之前版本没有出现这个问题。

Ops,图片没有顺利显示在 Github。

不知道您之前用的什么版本呢?考虑到最近有很多代码上的改动,如果是使用手动处理冲突的方式不知道会不会产生错误。

如果可以的话,可以提供一下您的 Archer 主题的 _config.yml 文件,可以帮助我们更好排查错误!

@lzwgiter
Copy link
Author

lzwgiter commented Aug 7, 2021

注意到您博客打印了 console 如下:

jquery.min.js:2 Uncaught ReferenceError: algolia is not defined
    at HTMLDocument.<anonymous> (search.js:15)
    at e (jquery.min.js:2)
    at t (jquery.min.js:2)

但是在网页的源文件里又顺利渲染出了:

<script>
  var hits = JSON.parse('{"per_page":10}')
  var labels = JSON.parse('{"input_placeholder":"Search for Posts","hits_empty":"We did not find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}')

  var algolia = {
    applicationID: '99K726IL0C',
    apiKey: '3afc6cf29d67683d23d7b0faccb5c7ab',
    indexName: 'float's blog',
    hits: hits,
    labels: labels
  }
</script>

我不确定是哪一个地方出了错误。测试我的博客在 Edge 和 Chrome 浏览器能顺利显示 Algolia 搜索功能。

您好!我archer老粉,今天刚刚换了最新1.6.3的版本,然后发现在本地生成的时候hexo -g,会出现打印很多行SEO_Keywords的情况,如果我没有写这些Keywords的话则会打印很多空白行。问题图如下,但之前版本没有出现这个问题。

Ops,图片没有顺利显示在 Github。

不知道您之前用的什么版本呢?考虑到最近有很多代码上的改动,如果是使用手动处理冲突的方式不知道会不会产生错误。

如果可以的话,可以提供一下您的 Archer 主题的 _config.yml 文件,可以帮助我们更好排查错误!

我的主题_config.yml文件如下:
_config.txt

@lzwgiter
Copy link
Author

lzwgiter commented Aug 7, 2021

您好!我archer老粉,今天刚刚换了最新1.6.3的版本,然后发现在本地生成的时候hexo -g,会出现打印很多行SEO_Keywords的情况,如果我没有写这些Keywords的话则会打印很多空白行。问题图如下,但之前版本没有出现这个问题。

------------------ 原始邮件 ------------------ 发件人: "fi3ework/hexo-theme-archer" @.>; 发送时间: 2021年8月7日(星期六) 晚上6:15 @.>; @.@.@.***>; 主题: Re: [fi3ework/hexo-theme-archer] Algolia站内搜索没有显示 (#306) Reopened #306. — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

问题图片如下,我不知这是否是正常现象
1
image

@LolipopJ
Copy link
Collaborator

LolipopJ commented Aug 7, 2021

问题图片如下,我不知这是否是正常现象

看上去是某次提交时为 base-head.ejs 文件添加了一个 console 输出:

<!-- keywords -->
<% var keywords = "" %>
<% var keywordsArr = [page.keywords, theme.SEO_keywords] %>
<% var keywords = keywordsArr.filter(function(item){ return item }).join(',') %>
<% console.log(keywords) %>

毫不影响任何功能,但这句语句本身是没有必要的,我将去掉它。

@lzwgiter
Copy link
Author

lzwgiter commented Aug 7, 2021

问题图片如下,我不知这是否是正常现象

看上去是某次提交时为 base-head.ejs 文件添加了一个 console 输出:

<!-- keywords -->
<% var keywords = "" %>
<% var keywordsArr = [page.keywords, theme.SEO_keywords] %>
<% var keywords = keywordsArr.filter(function(item){ return item }).join(',') %>
<% console.log(keywords) %>

毫不影响任何功能,但这句语句本身是没有必要的,我将去掉它。

看来是这样的,我测试没有问题了

@LolipopJ
Copy link
Collaborator

LolipopJ commented Aug 7, 2021

现在您的博客一切功能正常了!


刚刚浏览您博客发现 Archer 主题对原文链接处的中文分词处理并不好。这可以为其中的 <a /> 标签添加 word-break: break-all; 解决。

或者也可以尝试食用 Archer 主题的 dev 分支,刚刚我修复了这个问题。我将关闭此 Issue.🥳

@LolipopJ LolipopJ closed this as completed Aug 7, 2021
@lzwgiter
Copy link
Author

lzwgiter commented Aug 7, 2021

现在您的博客一切功能正常了!

刚刚浏览您博客发现 Archer 主题对原文链接处的中文分词处理并不好。这可以为其中的 标签添加 word-break: break-all; 解决。

或者也可以尝试食用 Archer 主题的 dev 分支,刚刚我修复了这个问题。我将关闭此 Issue.🥳

好的!多谢您的帮助,祝愿Archer越来越好

LolipopJ added a commit that referenced this issue Aug 24, 2021
🛎️ One-click translation by Google. 中文更新内容见 #307 

## Feat

1. Now you can set the avatar on the homepage to be borderless
2. The Hash value of the address bar is automatically modified to the corresponding Toc value as the article page scrolls
3. When the Toc is too long, the Toc directory will [scroll] as the article page scrolls (https://github.com/fi3ework/hexo-theme-archer/projects/1#card-64443923)
4. Add support for floating elements
5. The article with summary content enabled can be configured to display the "read more" button
6. Now you can configure the search function in the Profile bar to check the SEO status of your blog
7. Now the Profile bar can be customized to add more menus or links (#308)

## Change

1. The breakpoint on the mobile terminal is changed from `980px` to `960px`
2. When you click the Toc directory of the article page to jump, the banner is forced to be displayed, and space for the banner is reserved
3. The threshold for scrolling up the article page to display the Banner is changed from `500px` to `200px`
4. Part of the theme configuration of `Other` in `_config.yml` is moved to `Theme`.
5. Remove the Anchor button of the title in the homepage summary

## Fix

1. Fix the [Issue](#306 (comment)) that the Chinese word segmentation of the original link in the article page License does not automatically break.
2. Fix the problem that the page may display abnormally when opening Algolia search under certain pages
3. When the loading is not completed, the sidebar opening animation is no longer displayed incorrectly
4. Fix the problem that the Toc of the article page scrolls with the page to highlight the error
5. Fix the situation where floating elements may be displayed incorrectly on the article page (#309)

## Style

1. Adapt the color of the table in the article in Dark mode
2. Optimize the color configuration of Dark mode
3. Optimize the style of the 404 page
4. Optimize the display of the article page on the mobile terminal
5. Optimize the display of the sidebar on the mobile terminal
6. Optimize the display of the homepage summary and limit the height of the picture
7. Optimize the display effect when switching pages in Dark mode

## Perf

1. Improve browser scrolling performance
2. Optimize page loading performance

## Revert

1. Feature font is no longer used in sidebar article titles
2. Remove the useless Background-holder

## Chore

1. Put the content of the update log in the `CHANGELOG.md file instead of ` README.md`

## Dev

1. Provide `source_version` configuration, one-click to modify the source file version date
2. Add `.editorconfig` file
Stark-X pushed a commit to Stark-X/hexo-theme-archer that referenced this issue Apr 1, 2024
🛎️ One-click translation by Google. 中文更新内容见 fi3ework#307 

## Feat

1. Now you can set the avatar on the homepage to be borderless
2. The Hash value of the address bar is automatically modified to the corresponding Toc value as the article page scrolls
3. When the Toc is too long, the Toc directory will [scroll] as the article page scrolls (https://github.com/fi3ework/hexo-theme-archer/projects/1#card-64443923)
4. Add support for floating elements
5. The article with summary content enabled can be configured to display the "read more" button
6. Now you can configure the search function in the Profile bar to check the SEO status of your blog
7. Now the Profile bar can be customized to add more menus or links (fi3ework#308)

## Change

1. The breakpoint on the mobile terminal is changed from `980px` to `960px`
2. When you click the Toc directory of the article page to jump, the banner is forced to be displayed, and space for the banner is reserved
3. The threshold for scrolling up the article page to display the Banner is changed from `500px` to `200px`
4. Part of the theme configuration of `Other` in `_config.yml` is moved to `Theme`.
5. Remove the Anchor button of the title in the homepage summary

## Fix

1. Fix the [Issue](fi3ework#306 (comment)) that the Chinese word segmentation of the original link in the article page License does not automatically break.
2. Fix the problem that the page may display abnormally when opening Algolia search under certain pages
3. When the loading is not completed, the sidebar opening animation is no longer displayed incorrectly
4. Fix the problem that the Toc of the article page scrolls with the page to highlight the error
5. Fix the situation where floating elements may be displayed incorrectly on the article page (fi3ework#309)

## Style

1. Adapt the color of the table in the article in Dark mode
2. Optimize the color configuration of Dark mode
3. Optimize the style of the 404 page
4. Optimize the display of the article page on the mobile terminal
5. Optimize the display of the sidebar on the mobile terminal
6. Optimize the display of the homepage summary and limit the height of the picture
7. Optimize the display effect when switching pages in Dark mode

## Perf

1. Improve browser scrolling performance
2. Optimize page loading performance

## Revert

1. Feature font is no longer used in sidebar article titles
2. Remove the useless Background-holder

## Chore

1. Put the content of the update log in the `CHANGELOG.md file instead of ` README.md`

## Dev

1. Provide `source_version` configuration, one-click to modify the source file version date
2. Add `.editorconfig` file
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