AngularJS SEO 元数据和描述标签

AngularJS SEO Meta and Description Tags

我已经开始为手机制作一些 AngularJS 应用程序,最近客户要求将其中一个应用程序发送到桌面以使其响应式 multi-channel 架构。

我在几个网站上看到过这个:

<meta name="keywords" ng-if="Meta.keywords" ng-attr-content="{{ Meta.keywords }}">
<meta name="description" ng-if="Meta.description" ng-attr-content="{{ Meta.description }}">

当 Google 或其他机器人扫描时,他们可以看到输出 HTML 关键字数据,这也适用于内容和标题标签。 Angular 对 SEO 有多好?

Google processes JavaScript 因此其中生成的内容可供 googlebot 抓取。其他爬虫在确认他们这样做之前没有说明他们是否可以这样做,应该假设他们无法使用此内容。

仅供参考,元标记对排名没有影响。元描述 可能 显示在 Google 的搜索结果中 but not always

<meta name="keywords" ng-if="Meta.keywords" ng-attr-content="{{ Meta.keywords }}">
<meta name="description" ng-if="Meta.description" ng-attr-content="{{ Meta.description }}">

提示: 为了避免在你的 index.html 文件中有这个(例如,对于非 js 爬虫或者如果 js 有问题)只需在你的 head 标签中放置一个指令。这是最干净的方法。看看这个 directive,它将规范、关键字、元数据呈现到您的 head 标签中。

将您自己的指令映射到头标签集

restrict: 'E',

angular.module('app').directive('head', ['$rootScope'
function($rootScope) {

---

我有一些网站,其中 google 肯定会收听我的 angular 呈现的规范标签的内容(没有 html 快照,带有站点地图).