XPoet / hexo-theme-keep

:rainbow: A simple and light theme for Hexo. It makes you more focused on writing.
https://xpoet.cn
GNU Affero General Public License v3.0
1.29k stars 176 forks source link

搜索模块怎么设置 #6

Closed leungchiwah closed 3 years ago

leungchiwah commented 4 years ago

求教

XPoet commented 4 years ago

@leungchiwah

在主题配置文件 _config.yml 里面进行搜索功能相关的配置,enable 的值设为 true 即可启用。

注意:搜索功能需额外安装 Hexo 插件 hexo-generator-searchdb,在 Hexo 项目根目录下,使用 npm 安装,命令:npm install hexo-generator-searchdb

参考下我的配置

local_search:
  enable: true
  trigger: auto
  unescape: false
  preload: true
leungchiwah commented 4 years ago

请问 主配置文件要配置吗?

leungchiwah commented 4 years ago

嗯 这部分都操作都一样,但是主配置文件你怎么设置的

------------------ 原始邮件 ------------------ 发件人: "指间的诗意"<notifications@github.com>; 发送时间: 2020年7月2日(星期四) 下午5:36 收件人: "XPoet/hexo-theme-ils"<hexo-theme-ils@noreply.github.com>; 抄送: "梁子桦"<429612158@qq.com>; "Mention"<mention@noreply.github.com>; 主题: Re: [XPoet/hexo-theme-ils] 搜索模块怎么设置 (#6)

@leungchiwah

在主题配置文件 _config.yml 里面进行搜索功能相关的配置,enable 的值设为 true 即可启用。

注意:搜索功能需额外安装 Hexo 插件 hexo-generator-searchdb,在 Hexo 项目根目录下,使用 npm 安装,命令:npm install hexo-generator-searchdb。

参考下我的配置 local_search: enable: true trigger: auto unescape: false preload: true

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

XPoet commented 4 years ago

@leungchiwah 不好意思,主配置文件也需要增加一些配置,搞忘了。 在 Hexo 的配置文件里面增加如下配置就行了

# Search
## https://github.com/theme-next/hexo-generator-searchdb
search:
  path: search.json
  field: post
  content: true
  format: striptags
leungchiwah commented 4 years ago

好了谢谢,评论模块我也想弄.

------------------ 原始邮件 ------------------ 发件人: "指间的诗意"<notifications@github.com>; 发送时间: 2020年7月2日(星期四) 下午5:56 收件人: "XPoet/hexo-theme-ils"<hexo-theme-ils@noreply.github.com>; 抄送: "梁子桦"<429612158@qq.com>;"Mention"<mention@noreply.github.com>; 主题: Re: [XPoet/hexo-theme-ils] 搜索模块怎么设置 (#6)

@leungchiwah 不好意思,主配置文件也需要增加一些配置,搞忘了。 在 Hexo 的配置文件里面增加如下配置就行了

Search ## https://github.com/theme-next/hexo-generator-searchdb search: path: search.json field: post content: true format: striptags

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

XPoet commented 4 years ago

评论功能只需在主题配置文件里面进行相关的配置

# comment plugin
# 评论插件,主题内置了 Valine 和 Gitalk,只能使用其中一款,如果 enable 都设为了 true,将使用 Valine。
comments:
  # Valine https://github.com/xCss/Valine
  # 如何使用 Valine 请参考:https://github.com/xCss/Valine
  valine:
    enable: false
    appid:   # 你的 leancloud appid
    appkey:  # 你的 leancloud appkey
    meta: ['nick', 'mail', 'link']  # 评论框要填写的选项
    placeholder: 😜尽情吐槽吧~

  # Gitalk https://github.com/gitalk/gitalk
  # 如何使用 Gitalk 请参考:https://github.com/gitalk/gitalk
  gitalk:
    enable: false
    github_id:      # 你的 GitHub ID
    repository:     # 你的 GitHub 仓库名
    client_id:      # 你的 GitHub Application Client ID
    client_secret:  # 你的 GitHub Application Client Secret
leungchiwah commented 4 years ago

搞好了,以后有需要其他功能再请教你.谢谢

------------------ 原始邮件 ------------------ 发件人: "指间的诗意"<notifications@github.com>; 发送时间: 2020年7月2日(星期四) 晚上6:20 收件人: "XPoet/hexo-theme-ils"<hexo-theme-ils@noreply.github.com>; 抄送: "梁子桦"<429612158@qq.com>;"Mention"<mention@noreply.github.com>; 主题: Re: [XPoet/hexo-theme-ils] 搜索模块怎么设置 (#6)

评论功能只需在主题配置文件里面进行相关的配置

comment plugin # 评论插件,主题内置了 Valine 和 Gitalk,只能使用其中一款,如果 enable 都设为了 true,将使用 Valine。 comments: # Valine https://github.com/xCss/Valine # 如何使用 Valine 请参考:https://github.com/xCss/Valine valine: enable: false appid: # 你的 leancloud appid appkey: # 你的 leancloud appkey meta: ['nick', 'mail', 'link'] # 评论框要填写的选项 placeholder: 😜尽情吐槽吧~ # Gitalk https://github.com/gitalk/gitalk # 如何使用 Gitalk 请参考:https://github.com/gitalk/gitalk gitalk: enable: false github_id: # 你的 GitHub ID repository: # 你的 GitHub 仓库名 client_id: # 你的 GitHub Application Client ID client_secret: # 你的 GitHub Application Client Secret

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.