happypeter / haoduoshipin

好多视频

Home Page:http://haoduoshipin.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

网站搜索和 SEO

happypeter opened this issue · comments

目前完成的功能效果,是这样实现的:

  • 首页添加一个指向 /search.html 页面的搜索框
  • search.html 页面中采用“嵌入式”的页面展示效果

网站上线一天多了,还是搜不到 haoduoshipin.com 主站的内容,只能搜到一些 boo.haoduoshipin.com 的老内容

s三天了,还是搜不到

谷歌现在已经能搜到 haoduoshipin.com 了,百度还不行

可以自己提交种子 URL 的,帮助文档里有具体方式,我提交了

haoduoshipin.com

目前只能搜出一个页面来 http://haoduoshipin.com/v/37

嗯,还是不行,搜不到

提交了网页列表,生效时间1-2天

提交的方式是什么?写了了脚本生成了一个 sitemap ?

直接在网站上添加了一个 sitemap 文件,然后百度搜索设置中指定 sitemap 文件的路径就行了

生成 sitemap 文件是怎么操作的?是不是用了一个脚本?贴到这里吧

const fs = require('fs');
const a = [];
for(i = 204; i > 0; i--) {
  a.push(`http://www.haoduoshipin.com/v/${i}.html\n`);
}
fs.writeFileSync('./sitemap.txt', a.join('').trim());

百度搜索终于生效了,搜索记录的标题有的显示 haoduoshipin;有的显示视频标题。

因为页面文档标题都设置为了 haoduoshipin,若搜索项标题为 haoduoshipin,说明百度收录了好多视频的网页,搜索项的标题即为页面文档标题;若搜索项标题为正确的视频标题
,说明后台提交的结构化数据 sitemap.xml 文件链接也生效了。

搜索生效等待时间是比较长的,不是文档中所说的1-2天的时间

嗯嗯,厉害厉害。

sitmap.txt 要存放到哪里?

是 sitemap.xml 文件,放到项目根目录下

嗯,的确

peter@fire:~/haoduo-dist$ ls
css  index.html  search.html  sitemap.txt  sitemap.xml  v
peter@fire:~/haoduo-dist$

上面的 sitemap.txt 直接删除就可以了。

最新发布的几篇文章搜不到,所以我更新了一下 sitemap.xml ,看看几天后能搜到。

用这个 http://haoduoshipin.com/search.html?q=markdown

搜 208.html 试试