我可以让我的ajax网站“可抓取”吗?

时间:2022-05-02 22:50:03

I'm currently building a music based website and I want to build something like this template. It uses ajax and deep linking. (And it makes use of the History.js library - please notice how there's no '#' in the URLs.)

我目前正在建立一个基于音乐的网站,我想构建类似这个模板的东西。它使用ajax和深层链接。 (并且它使用了History.js库 - 请注意URL中没有'#'。)

The reason I want to use these 'ajaxy' methods (or maybe use the template altogether) is so that when music is playing, it will remain un-interrupted as the user navigates the site.

我想使用这些'ajaxy'方法(或者可能完全使用模板)的原因是,当音乐播放时,它将在用户导航网站时保持不间断。

My worry is that my site wont be crawlable by Google but I think I can modify code in the page source to fix that. If I look at the source code to the template, in the head I see

我担心我的网站不会被Google抓取,但我想我可以修改页面来源中的代码来解决这个问题。如果我查看模板的源代码,我会看到

<meta name="description" content="">
<meta name="author" content="">
<meta name="keywords" content="">

Now if I add this to the head:

现在如果我把它添加到头部:

<meta name="fragment" content="!">

will that make the site crawlable? Is there other code I need to add on top of this? Or is it just not possible for this template?

会使网站可抓取吗?我还需要添加其他代码吗?或者这个模板是不可能的?

I'm following this guide https://developers.google.com/webmasters/ajax-crawling/docs/getting-started, and I'm on step 3. I will of course have to complete the other steps but I don't know I'm heading in the right direction, or heading towards a dead end!

我正在关注此指南https://developers.google.com/webmasters/ajax-crawling/docs/getting-started,我正在第3步。我当然要完成其他步骤,但我不知道我知道我正朝着正确的方向前进,或走向死胡同!

Any help would be very much appreciated. Many thanks in advance.

任何帮助将非常感谢。提前谢谢了。

1 个解决方案

#1


0  

From what you said it sounds like your site updates the address bar with clean urls as you navigate via ajax. That's good. The next thing is you want to do is make sure those urls work. If you directly go to a url do you see the specific content it represents. And would a crawler also see the correct content without running javascript. Progressive enhancement works well for that. The final thing is you want to do is make sure bots can pick up those urls. I've not played with the meta tag for ! But it looks like it is only for the home page and you still need to implement the escaped fragment page. Maybe it does support other pages but the article does not cover that.

从您所说的内容来看,当您通过ajax导航时,您的网站会使用干净的网址更新地址栏。那很好。接下来要做的就是确保这些网址有效。如果直接转到网址,您会看到它代表的具体内容。如果没有运行javascript,爬虫也会看到正确的内容。渐进增强效果很好。你要做的最后一件事是确保机器人可以拿起那些网址。我没玩过meta标签!但看起来它只适用于主页,您仍然需要实现转义的片段页面。也许它确实支持其他页面,但文章没有涉及到这一点。

#1


0  

From what you said it sounds like your site updates the address bar with clean urls as you navigate via ajax. That's good. The next thing is you want to do is make sure those urls work. If you directly go to a url do you see the specific content it represents. And would a crawler also see the correct content without running javascript. Progressive enhancement works well for that. The final thing is you want to do is make sure bots can pick up those urls. I've not played with the meta tag for ! But it looks like it is only for the home page and you still need to implement the escaped fragment page. Maybe it does support other pages but the article does not cover that.

从您所说的内容来看,当您通过ajax导航时,您的网站会使用干净的网址更新地址栏。那很好。接下来要做的就是确保这些网址有效。如果直接转到网址,您会看到它代表的具体内容。如果没有运行javascript,爬虫也会看到正确的内容。渐进增强效果很好。你要做的最后一件事是确保机器人可以拿起那些网址。我没玩过meta标签!但看起来它只适用于主页,您仍然需要实现转义的片段页面。也许它确实支持其他页面,但文章没有涉及到这一点。