Angularjs SPA和生成网站地图 [英] Angularjs SPA and generating sitemap

查看:131
本文介绍了Angularjs SPA和生成网站地图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道的做法产生了角水疗中心的应用程序站点地图。

基本上我有一个主页和其他网页,用户可以发表不同条目,有点像一个forum.Very简单。

想知道什么将是生成一个网站地图,而不是一个正常的非水疗站点不同。

另外,请注意,从今年5月起谷歌有能力的JavaScript生成的​​页面索引。

http://googlewebmastercentral.blogspot.ro/2014/05/understanding-web-pages-better.html


解决方案

我不知道上述评论的目的是什么 - 这个特殊的问题似乎pretty清晰(共同)给我。

谷歌可以做很多事情来索引JS现在的应用,但大部分是努力成为懒加载的内容敏感。今天有许多网站,像评论溪流,侧边栏小工具,有时甚至是主要内容为空白页shell作为一个单独的资源负载的东西。如果没有做对他们做什么具体的陈述,有什么谷歌已经暗示是,他们是pretty擅长处理这种类型的东西了。

这并不意味着他们将真正锻炼你的应用程序,并在SPA的风险是非常高的,他们不会发现你希望他们做的一切。这就是你需要带回去给你的数据模型,这你知道的比别人更好的架构问题。你最好的结果将来自使用服务器端code(通常在批处理作业)来生成原始数据模式的sitemap.xml的。您可以生成所有你知道你的应用程序将作出回应,并设置站点地图了,以准确反映您希望您的应用编入索引的方式的URL。

然后

谷歌能打到相应的网页,和所有你需要做的是确保当他们这样做,这些页面将没有进一步的交互工作。这样,他们没有遵循程序页面本身内的链接。

Im wondering on practices to generate a sitemap for a angular spa application.

Basically i got a single homepage, and other pages where users can post various entries, kinda like a forum.Very simple.

Wondering what would be different in generating a sitemap for that as opposed to a normal non-spa site.

Also please notice that starting from may this year google is capable of indexing javascript generated pages.

http://googlewebmastercentral.blogspot.ro/2014/05/understanding-web-pages-better.html

解决方案

I'm not sure what the purpose of the above comment is - this particular question seems pretty clear (and common) to me.

Google can do a lot to index JS apps now but most of it is trying to be sensitive to lazy-loaded content. There are many sites today that load things like comment streams, sidebar widgets, and sometimes even primary content into an empty page shell as a separate resource. Without making specific statements about exactly what they do, what Google has implied is that they're pretty good at dealing with this type of thing now.

That doesn't mean they're going to actually exercise your app, and in an SPA the risk is very high that they won't discover everything you want them to do. This is an architectural problem that you need to take back to your data model, which you know better than anybody else. Your best result is going to come from using server-side code (usually in a batch job) to generate a sitemap.xml from your raw data schema. You can generate all the URLs you know your app will respond to and set the sitemap up to accurately reflect the way you want your app indexed.

Google can then hit each of those pages, and all you need to do is make sure that when they do, those pages will work without further interaction. That way they don't have to follow links within the app pages themselves.

这篇关于Angularjs SPA和生成网站地图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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