【问题标题】:Why does a search engine summary contain text that is not in any of the static html files?为什么搜索引擎摘要包含不在任何静态 html 文件中的文本?
【发布时间】:2017-07-24 02:17:56
【问题描述】:

我有一个 hugo 网站,在搜索引擎 (Duckduckgo) 上,我的网站摘要是:

Add your own "layouts/partials/hero.html" to replace this text.

我尝试在public 文件夹中的文件中查找字符串hero,但似乎找不到。

我已经添加了这个包含一些内容的文件。似乎什么也没有发生。我需要编辑主题文件还是什么?

编辑:更改了标题以使问题更清晰。最初的问题是关于“英雄卡”,我认为这可能是网站的标准搜索引擎友好部分。

【问题讨论】:

  • 你用的是什么主题?
  • detox 但它最初是base16,我认为这是导致问题的原因,我想我现在知道答案了。谢谢 - 您的评论帮助我解决了问题。

标签: hugo duckduckgo


【解决方案1】:

我想我明白现在发生了什么。我最初安装了包含文本的base16 主题:

Add your own "layouts/partials/hero.html" to replace this text.

(在文件themes\base16\layouts\partials\hero.html.)。

我应该意识到,但搜索引擎需要时间来重新索引网站。我最初使用base16 发布了该站点,其中一些文本未经编辑。 Duckduckgo 显示的是旧文本,当网站重新索引时,它可能会及时消失。

【讨论】:

    【解决方案2】:

    答案在documentation for the base16 theme

    您可能想要编辑主页。从复制开始 为您自己的网站提供主页。

    $ mkdir -p layouts/partials
    $ cp themes/base16/layouts/partials/hero.html layouts/partials/hero.html
    

    在此之后,您可以编辑layouts/partials/hero.html并使其 太棒了。

    default layouts/partials/hero.html 包含代码 Add your own "<code>layouts/partials/hero.html</code>" to replace this text.,这是 DuckDuckGo 用来进行摘要的代码。正如您在上面的回答中所指出的,如果您编辑此文件,那么 DuckDuckGo 的摘要应该会在 DuckDuckGo 下次索引您的网站时发生变化。

    【讨论】:

      猜你喜欢
      • 2016-06-09
      • 1970-01-01
      • 2018-05-15
      • 1970-01-01
      • 2022-07-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-07-22
      相关资源
      最近更新 更多