简体   繁体   中英

Why does a search engine summary contain text that is not in any of the static html files?

I have a hugo site, and on a search engine (Duckduckgo), my site's summary is:

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

I tried looking for the string hero in the files in my public folder, can't seem to find it.

I have added this file with some content. Nothing seems to happen. Do I need to edit the theme files or something?

Edit: changed title to make problem clearer. The original question asked about "hero cards", which I thought might have been a standard search engine friendly part of a website.

I think I understand what is happening now. I originally installed the base16 theme which does contain the text:

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

( it is in the file themes\\base16\\layouts\\partials\\hero.html .).

I should have realised, but search engines take time to re-index a site. I originally published the site using base16 with some text unedited. Duckduckgo was showing that old text, it will probably disappear in time when the site is reindexed.

The answer is in the documentation for the base16 theme :

You probably want to edit the homepage. Get started by copying the supplied homepage to your own site.

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

After this, you can edit layouts/partials/hero.html and make it awesome.

The default layouts/partials/hero.html contains the code Add your own "<code>layouts/partials/hero.html</code>" to replace this text. , which is what DuckDuckGo was using to make its summary. As you noted in your answer above, if you edit this file then the DuckDuckGo summary should change when DuckDuckGo next indexes your site.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM