我看到 AngularJS 应用程序有两个关于搜索引擎和 SEO 的问题:
1) 自定义标签会发生什么?搜索引擎是否会忽略这些标签中的全部内容?即假设我有
<custom>
<h1>Hey, this title is important</h1>
</custom>
<h1>
尽管位于自定义标签内,但仍被编入索引?<h2>{{title}}</h2>
<h2 ng-bind="title"></h2>
最佳答案
2014 年 5 月更新
Google 抓取工具 now executes javascript - 您可以使用 Google Webmaster Tools更好地了解 Google 如何呈现您的网站。
原答案
如果您想针对搜索引擎优化您的应用程序,很遗憾没有办法为爬虫提供预渲染版本。您可以阅读有关 Google 对 ajax 和 javascript 密集型网站的建议的更多信息 here .
如果这是一个选项,我建议您阅读 this article关于如何使用服务器端渲染为 Angular 进行 SEO。
我不确定爬虫遇到自定义标签时会做什么。
https://stackoverflow.com/questions/13499040/