new_audit(seo): manual SEO audits (#4108)

* Add two manual audits to the SEO category

* Rename the manual validation SEO group
This commit is contained in:
Konrad Dzwinel 2018-01-03 23:42:45 +01:00 коммит произвёл Patrick Hulce
Родитель f6234d0a6d
Коммит 175396a792
4 изменённых файлов: 63 добавлений и 0 удалений

Просмотреть файл

@ -0,0 +1,27 @@
/**
* @license Copyright 2017 Google Inc. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
*/
'use strict';
const ManualAudit = require('../../manual/manual-audit');
/**
* @fileoverview Manual SEO audit to check if page is mobile friendly.
*/
class MobileFriendly extends ManualAudit {
/**
* @return {!AuditMeta}
*/
static get meta() {
return Object.assign({
name: 'mobile-friendly',
helpText: 'Take the [Mobile-Friendly Test](https://search.google.com/test/mobile-friendly) to see how easily a visitor can use your page on a mobile device. [Learn more](https://developers.google.com/search/mobile-sites/).',
description: 'Page is mobile friendly',
}, super.meta);
}
}
module.exports = MobileFriendly;

Просмотреть файл

@ -0,0 +1,27 @@
/**
* @license Copyright 2017 Google Inc. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
*/
'use strict';
const ManualAudit = require('../../manual/manual-audit');
/**
* @fileoverview Manual SEO audit to check if structured data on page is valid.
*/
class StructuredData extends ManualAudit {
/**
* @return {!AuditMeta}
*/
static get meta() {
return Object.assign({
name: 'structured-data',
helpText: 'Run the [Structured Data Testing Tool](https://search.google.com/structured-data/testing-tool/) and the [Structured Data Linter](http://linter.structured-data.org/) to validate structured data. [Learn more](https://developers.google.com/search/docs/guides/mark-up-content).',
description: 'Structured data is valid',
}, super.meta);
}
}
module.exports = StructuredData;

Просмотреть файл

@ -171,6 +171,8 @@ module.exports = {
'seo/link-text',
'seo/is-crawlable',
'seo/hreflang',
'seo/manual/mobile-friendly',
'seo/manual/structured-data',
],
groups: {
@ -241,6 +243,10 @@ module.exports = {
title: 'Crawling and Indexing',
description: 'To appear in search results, crawlers need access to your app.',
},
'manual-seo-checks': {
title: 'Additional items to manually check',
description: 'Run these additional validators on your site to check additional SEO best practices.',
},
},
categories: {
'performance': {
@ -380,6 +386,8 @@ module.exports = {
{id: 'is-crawlable', weight: 1, group: 'seo-crawl'},
{id: 'hreflang', weight: 1, group: 'seo-content'},
{id: 'font-size', weight: 1, group: 'seo-mobile'},
{id: 'mobile-friendly', weight: 0, group: 'manual-seo-checks'},
{id: 'structured-data', weight: 0, group: 'manual-seo-checks'},
],
},
},

Просмотреть файл

@ -259,6 +259,7 @@ class Runner {
...fs.readdirSync(path.join(__dirname, './audits')),
...fs.readdirSync(path.join(__dirname, './audits/dobetterweb')).map(f => `dobetterweb/${f}`),
...fs.readdirSync(path.join(__dirname, './audits/seo')).map(f => `seo/${f}`),
...fs.readdirSync(path.join(__dirname, './audits/seo/manual')).map(f => `seo/manual/${f}`),
...fs.readdirSync(path.join(__dirname, './audits/accessibility'))
.map(f => `accessibility/${f}`),
...fs.readdirSync(path.join(__dirname, './audits/accessibility/manual'))