单页应用程序的搜索引擎索引 [英] Search engine indexing of single page applications

查看:58
本文介绍了单页应用程序的搜索引擎索引的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好的,所以我已经编写Backbone.js应用程序已有一年多了,我喜欢框架模型.我已经学会了如何避免所有此类陷阱,但是作为一个单页面应用程序开发人员,我仍然有一个领域仍然很薄弱:如何对面向公众的应用程序进行SEO.

Alright so I've been writing Backbone.js apps for over a year now and I love the framework model. I've learned how to avoid all the pitfalls and such, but there's one area I'm still quite weak as a single page app developer: how to SEO a public facing app.

我正在开发一个博客项目,我想到的最简单的解决方案是让服务器生成的所有博客条目的列表显示为/blog 部分中的链接,该列表显示在页面加载,并确保在点击/blog/:id url时,服务器将博客内容加载到页面上的第一个div中,该div将设置为 display:none.

I'm working on a blog project, and the easiest solution to my mind is to have a server generated list of all blog entries visible as a link from the /blog section that is rendered on page load, and to ensure that when hitting a /blog/:id url, the server loads the blog content into the very first div on the page, which will be set as display:none.

我的问题是,这对于一个好的搜索引擎索引是否应该足够?SEO仍然是我作为开发人员的最薄弱的技能.是否有确保搜索引擎首先抓取该内容并能够将其用于更复杂的索引的技术?

My question is if this should be sufficient for a good search engine index? SEO is still my weakest skill as a developer. Are there techniques for making sure a search engine crawls this content first and is able to use that content for its more complex indexing?

还有,有一种方法可以将页面上生成的应用程序内容列入黑名单,因为我知道Google一直在测试抓取的JavaScript应用程序?在我看来,如果没有某种标准的浏览器级别的事件,就无法在整个级别上完成该事件,而该事件可以在整页渲染中或在加载所有数据之后触发.

Also, is there a way to blacklist the generated app content on the page as I know Google has been testing crawling JavaScript apps? In my mind that could never be done at the level it needs to be without some sort of standard browser level event that can be triggered on a full page render or after all data has been loaded.

无论如何,这更像是一张我知道的模棱两可的票,但是如果我们在这里得到一些好的答案,它最终可能对将来的人们有用.

Anyways, this is more of an ambiguous ticket I know, but it could end up being useful to people in the future if we get a collection of good answers here.

推荐答案

大多数主要搜索引擎(包括Google)都在渲染从网站接收的内容,在我们的案例中(谷歌),它使用的是无头浏览器.,因此无论您为用户做什么,搜索引擎都将获得它.但是,向搜索引擎提供不同的服务将使您进入一个危险的领域,称为伪装".

Most of the major search engines (including Google) are rendering the content they receive from the website, in our (Google's) case with something close to a headless browser, so whatever you do for the users the search engines will also get it. Serving different stuff to search engines however will get you into a dangerous area, named cloaking.

使用 display:none 隐藏内容可能会适得其反.我们给予隐藏内容的方式在排名中的权重较小.

Hiding the content with a display:none might backfire on you. We are giving hidden content way less weight in ranking.

这篇关于单页应用程序的搜索引擎索引的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆