Commit 0733a90
feat: introduce headings audit in preflight (#1562)
This PR adds headings issues detection to the preflight audit. When a
webpage is scraped, all heading elements are validated and are reported
with SEO impact, actionable recommendations and AI generated
suggestions.
The headings audit in preflight will now return opportunities in this
format:
```
{
"result": [
{
"pageUrl": "https://author-p125761-e1234605.adobeaemcloud.com/content/aso-preflight/index/preflight-headings-test.html",
"step": "suggest",
"audits": [
{
"name": "headings",
"type": "seo",
"opportunities": [
{
"check": "heading-missing-h1",
"seoRecommendation": "Pages should have exactly one H1 element for SEO and accessibility.",
"issue": "Missing H1 Heading",
"issueDetails": "Page does not have an H1 element",
"seoImpact": "High",
"aiSuggestion": "Explore Pain Perception: Insights and Reflections"
},
{
"check": "heading-order-invalid",
"seoRecommendation": "Heading levels should increase by one (example: H1→H2), not jump levels (example: H1→H3).",
"issue": "Invalid Heading Order",
"issueDetails": "Heading hierarchy skips levels.",
"seoImpact": "Moderate",
"suggestion": "Adjust heading levels to maintain proper hierarchy."
},
{
"check": "heading-order-invalid",
"seoRecommendation": "Heading levels should increase by one (example: H1→H2), not jump levels (example: H1→H3).",
"issue": "Invalid Heading Order",
"issueDetails": "Heading hierarchy skips levels.",
"seoImpact": "Moderate",
"suggestion": "Adjust heading levels to maintain proper hierarchy."
}
]
}
]
}
]
}
```
Please ensure your pull request adheres to the following guidelines:
- [ ] make sure to link the related issues in this description
- [ ] when merging / squashing, make sure the fixed issue references are
visible in the commits, for easy compilation of release notes
- [ ] If data sources for any opportunity has been updated/added, please
update the
[wiki](https://wiki.corp.adobe.com/display/AEMSites/Data+Sources+for+Opportunities)
for same opportunity.
## Related Issues
Thanks for contributing!
---------
Co-authored-by: radhikagpt1208 <[email protected]>1 parent 008f5f5 commit 0733a90
File tree
8 files changed
+787
-74
lines changed- src
- headings
- preflight
- test
- audits
- fixtures/preflight
8 files changed
+787
-74
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
34 | 35 | | |
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
38 | 39 | | |
39 | 40 | | |
| 41 | + | |
40 | 42 | | |
41 | 43 | | |
42 | 44 | | |
43 | 45 | | |
44 | 46 | | |
45 | 47 | | |
| 48 | + | |
46 | 49 | | |
47 | 50 | | |
48 | 51 | | |
49 | 52 | | |
50 | 53 | | |
51 | 54 | | |
| 55 | + | |
52 | 56 | | |
53 | 57 | | |
54 | 58 | | |
55 | 59 | | |
56 | 60 | | |
57 | 61 | | |
| 62 | + | |
58 | 63 | | |
59 | 64 | | |
60 | 65 | | |
61 | 66 | | |
62 | 67 | | |
63 | 68 | | |
| 69 | + | |
64 | 70 | | |
65 | 71 | | |
66 | 72 | | |
| |||
199 | 205 | | |
200 | 206 | | |
201 | 207 | | |
202 | | - | |
| 208 | + | |
203 | 209 | | |
204 | 210 | | |
205 | 211 | | |
| |||
218 | 224 | | |
219 | 225 | | |
220 | 226 | | |
221 | | - | |
| 227 | + | |
222 | 228 | | |
223 | 229 | | |
224 | 230 | | |
225 | | - | |
226 | | - | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
227 | 236 | | |
228 | 237 | | |
229 | | - | |
| 238 | + | |
230 | 239 | | |
| 240 | + | |
231 | 241 | | |
232 | | - | |
233 | | - | |
234 | | - | |
235 | | - | |
236 | | - | |
237 | 242 | | |
238 | 243 | | |
239 | | - | |
240 | | - | |
241 | | - | |
242 | | - | |
243 | | - | |
244 | | - | |
245 | | - | |
246 | | - | |
247 | 244 | | |
248 | | - | |
249 | | - | |
250 | 245 | | |
251 | | - | |
252 | | - | |
253 | | - | |
| 246 | + | |
| 247 | + | |
254 | 248 | | |
255 | 249 | | |
256 | | - | |
257 | | - | |
258 | | - | |
259 | | - | |
260 | | - | |
261 | | - | |
262 | | - | |
| 250 | + | |
263 | 251 | | |
264 | 252 | | |
265 | 253 | | |
| |||
282 | 270 | | |
283 | 271 | | |
284 | 272 | | |
| 273 | + | |
285 | 274 | | |
286 | 275 | | |
287 | 276 | | |
| |||
298 | 287 | | |
299 | 288 | | |
300 | 289 | | |
| 290 | + | |
301 | 291 | | |
302 | 292 | | |
303 | 293 | | |
| |||
312 | 302 | | |
313 | 303 | | |
314 | 304 | | |
| 305 | + | |
315 | 306 | | |
316 | 307 | | |
317 | 308 | | |
| |||
334 | 325 | | |
335 | 326 | | |
336 | 327 | | |
| 328 | + | |
337 | 329 | | |
338 | 330 | | |
339 | 331 | | |
| |||
390 | 382 | | |
391 | 383 | | |
392 | 384 | | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
393 | 432 | | |
394 | 433 | | |
395 | 434 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
| |||
46 | 47 | | |
47 | 48 | | |
48 | 49 | | |
| 50 | + | |
49 | 51 | | |
50 | 52 | | |
51 | 53 | | |
| |||
56 | 58 | | |
57 | 59 | | |
58 | 60 | | |
| 61 | + | |
59 | 62 | | |
60 | 63 | | |
61 | 64 | | |
62 | 65 | | |
63 | 66 | | |
64 | 67 | | |
| 68 | + | |
65 | 69 | | |
66 | 70 | | |
67 | 71 | | |
| |||
0 commit comments