wujun234 / hexo-theme-tree

MIT License
207 stars 62 forks source link

搜索引擎会把sidebar和博客最下面的下一篇博客的链接当成正文 #42

Closed seekstar closed 1 year ago

seekstar commented 2 years ago

比方说在https://wujun234.github.io/里以jackson为关键词进行全站搜索,跳出的谷歌搜索页面中的第四条是输出 sout 到日志文件

图片

但是这个博客的正文根本没有jackson

有没有什么方法在生成的html里标记这些都不是正文?

wujun234 commented 2 years ago

以目前的搜索方式,暂时没法区分

seekstar commented 2 years ago

好像可以用noindexhttps://blog.hubspot.com/marketing/how-to-unindex-pages-from-search-engines

里面有提到a portion of:

There are a few occasions where you may want to exclude a webpage — or a portion of a webpage — from search engine crawling and indexing

这个讲得比较细一点: https://www.business2community.com/seo/how-to-block-part-of-a-page-from-indexing-by-search-engines-02404854

这个也是讲怎么排除部分内容的,但是好像是只对谷歌有效:https://perishablepress.com/tell-google-to-not-index-certain-parts-of-your-page/

seekstar commented 2 years ago

Meta tag放到body里好像是不符合标准的:https://stackoverflow.com/questions/1447842/what-happens-if-the-meta-tags-are-present-in-the-document-body

然后googleon和googleoff好像没有被google officially documented:https://digitalreadymarketing.com/googleon-googleoff-tags/

所以可以把sidebar之类的放到另一个html里,然后在那个html的head里打上noindex的meta tag,然后把这个html嵌套到总的博客的html里吗?

wujun234 commented 2 years ago

这个你可以先试试看,主要最近精力没在这一块

seekstar commented 1 year ago

诶?这个问题解决了?

wujun234 commented 1 year ago

没有,刚刚浏览了一波,看比较久远,就关了