@rankcli/agent-runtime 0.0.15 → 0.0.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +43 -393
- package/dist/index.d.ts +43 -393
- package/dist/index.js +306 -6526
- package/dist/index.mjs +202 -6412
- package/package.json +6 -1
- package/scripts/build-deno.ts +0 -134
- package/src/analyzers/core-web-vitals-analyzer.test.ts +0 -236
- package/src/analyzers/core-web-vitals-analyzer.ts +0 -557
- package/src/analyzers/geo-analyzer.test.ts +0 -310
- package/src/analyzers/geo-analyzer.ts +0 -814
- package/src/analyzers/image-optimization-analyzer.test.ts +0 -145
- package/src/analyzers/image-optimization-analyzer.ts +0 -348
- package/src/analyzers/index.ts +0 -233
- package/src/analyzers/internal-linking-analyzer.test.ts +0 -141
- package/src/analyzers/internal-linking-analyzer.ts +0 -419
- package/src/analyzers/mobile-seo-analyzer.test.ts +0 -140
- package/src/analyzers/mobile-seo-analyzer.ts +0 -455
- package/src/analyzers/security-headers-analyzer.test.ts +0 -115
- package/src/analyzers/security-headers-analyzer.ts +0 -318
- package/src/analyzers/structured-data-analyzer.test.ts +0 -210
- package/src/analyzers/structured-data-analyzer.ts +0 -590
- package/src/audit/ai/analyzer.ts +0 -347
- package/src/audit/ai/index.ts +0 -29
- package/src/audit/ai/prompts/content-analysis.ts +0 -271
- package/src/audit/ai/types.ts +0 -179
- package/src/audit/checks/additional-checks.ts +0 -439
- package/src/audit/checks/agent-experience.ts +0 -108
- package/src/audit/checks/ai-citation-worthiness.ts +0 -399
- package/src/audit/checks/ai-content-structure.ts +0 -325
- package/src/audit/checks/ai-readiness.ts +0 -406
- package/src/audit/checks/anchor-text.ts +0 -179
- package/src/audit/checks/answer-conciseness.ts +0 -322
- package/src/audit/checks/asset-minification.ts +0 -270
- package/src/audit/checks/bing-optimization.ts +0 -206
- package/src/audit/checks/brand-mention-optimization.ts +0 -349
- package/src/audit/checks/caching-headers.ts +0 -305
- package/src/audit/checks/canonical-advanced.ts +0 -150
- package/src/audit/checks/canonical-domain.ts +0 -196
- package/src/audit/checks/citation-quality.ts +0 -358
- package/src/audit/checks/client-rendering.ts +0 -542
- package/src/audit/checks/color-contrast.ts +0 -342
- package/src/audit/checks/content-freshness.ts +0 -170
- package/src/audit/checks/content-science.ts +0 -589
- package/src/audit/checks/conversion-elements.ts +0 -526
- package/src/audit/checks/crawlability.ts +0 -220
- package/src/audit/checks/directory-listing.ts +0 -172
- package/src/audit/checks/dom-analysis.ts +0 -191
- package/src/audit/checks/dom-size.ts +0 -246
- package/src/audit/checks/duplicate-content.ts +0 -194
- package/src/audit/checks/eeat-signals.ts +0 -990
- package/src/audit/checks/entity-seo.ts +0 -396
- package/src/audit/checks/featured-snippet.ts +0 -473
- package/src/audit/checks/freshness-signals.ts +0 -443
- package/src/audit/checks/funnel-intent.ts +0 -463
- package/src/audit/checks/hreflang.ts +0 -174
- package/src/audit/checks/html-compliance.ts +0 -302
- package/src/audit/checks/image-dimensions.ts +0 -167
- package/src/audit/checks/images.ts +0 -160
- package/src/audit/checks/indexnow.ts +0 -275
- package/src/audit/checks/interactive-tools.ts +0 -475
- package/src/audit/checks/internal-link-graph.ts +0 -436
- package/src/audit/checks/keyword-analysis.ts +0 -239
- package/src/audit/checks/keyword-cannibalization.ts +0 -385
- package/src/audit/checks/keyword-placement.ts +0 -471
- package/src/audit/checks/links.ts +0 -273
- package/src/audit/checks/llms-txt.ts +0 -224
- package/src/audit/checks/local-seo.ts +0 -296
- package/src/audit/checks/mobile.ts +0 -167
- package/src/audit/checks/modern-images.ts +0 -226
- package/src/audit/checks/navboost-signals.ts +0 -395
- package/src/audit/checks/on-page.ts +0 -209
- package/src/audit/checks/page-resources.ts +0 -285
- package/src/audit/checks/pagination.ts +0 -180
- package/src/audit/checks/performance.ts +0 -153
- package/src/audit/checks/platform-presence.ts +0 -580
- package/src/audit/checks/rag-chunk-readiness.test.ts +0 -159
- package/src/audit/checks/rag-chunk-readiness.ts +0 -163
- package/src/audit/checks/redirect-analysis.ts +0 -153
- package/src/audit/checks/redirect-chain.ts +0 -389
- package/src/audit/checks/resource-hints.ts +0 -420
- package/src/audit/checks/responsive-css.ts +0 -247
- package/src/audit/checks/responsive-images.ts +0 -396
- package/src/audit/checks/review-ecosystem.ts +0 -415
- package/src/audit/checks/robots-validation.ts +0 -373
- package/src/audit/checks/security-headers.ts +0 -188
- package/src/audit/checks/security.ts +0 -144
- package/src/audit/checks/serp-preview.ts +0 -251
- package/src/audit/checks/site-maturity.ts +0 -453
- package/src/audit/checks/social-meta.test.ts +0 -275
- package/src/audit/checks/social-meta.ts +0 -134
- package/src/audit/checks/soft-404.ts +0 -151
- package/src/audit/checks/structured-data.ts +0 -238
- package/src/audit/checks/tech-detection.ts +0 -496
- package/src/audit/checks/topical-clusters.ts +0 -435
- package/src/audit/checks/tracker-bloat.ts +0 -462
- package/src/audit/checks/tracking-verification.test.ts +0 -371
- package/src/audit/checks/tracking-verification.ts +0 -636
- package/src/audit/checks/url-safety.ts +0 -682
- package/src/audit/deno-entry.ts +0 -66
- package/src/audit/discovery/index.ts +0 -15
- package/src/audit/discovery/link-crawler.ts +0 -233
- package/src/audit/discovery/repo-routes.ts +0 -347
- package/src/audit/engine.ts +0 -633
- package/src/audit/fixes/index.ts +0 -209
- package/src/audit/fixes/social-meta-fixes.test.ts +0 -329
- package/src/audit/fixes/social-meta-fixes.ts +0 -463
- package/src/audit/index.ts +0 -74
- package/src/audit/runner.test.ts +0 -299
- package/src/audit/runner.ts +0 -130
- package/src/audit/types.ts +0 -1987
- package/src/content/featured-snippet.ts +0 -367
- package/src/content/generator.test.ts +0 -534
- package/src/content/generator.ts +0 -501
- package/src/content/headline.ts +0 -317
- package/src/content/index.ts +0 -62
- package/src/content/intent.ts +0 -258
- package/src/content/keyword-density.ts +0 -349
- package/src/content/readability.ts +0 -262
- package/src/executor.ts +0 -336
- package/src/fixer/framework-fixes.test.ts +0 -489
- package/src/fixer/framework-fixes.ts +0 -5287
- package/src/fixer/index.ts +0 -6
- package/src/fixer/schemas.ts +0 -971
- package/src/fixer.ts +0 -642
- package/src/frameworks/detector.test.ts +0 -248
- package/src/frameworks/detector.ts +0 -899
- package/src/frameworks/index.ts +0 -68
- package/src/frameworks/recipes/angular.yaml +0 -171
- package/src/frameworks/recipes/astro.yaml +0 -206
- package/src/frameworks/recipes/django.yaml +0 -180
- package/src/frameworks/recipes/laravel.yaml +0 -137
- package/src/frameworks/recipes/nextjs.yaml +0 -268
- package/src/frameworks/recipes/nuxt.yaml +0 -175
- package/src/frameworks/recipes/rails.yaml +0 -188
- package/src/frameworks/recipes/react.yaml +0 -202
- package/src/frameworks/recipes/sveltekit.yaml +0 -154
- package/src/frameworks/recipes/vue.yaml +0 -137
- package/src/frameworks/recipes/wordpress.yaml +0 -209
- package/src/frameworks/suggestion-engine.ts +0 -357
- package/src/geo/geo-content.test.ts +0 -305
- package/src/geo/geo-content.ts +0 -266
- package/src/geo/geo-history.test.ts +0 -473
- package/src/geo/geo-history.ts +0 -433
- package/src/geo/geo-tracker.test.ts +0 -359
- package/src/geo/geo-tracker.ts +0 -411
- package/src/geo/index.ts +0 -11
- package/src/geo/llm-citation-checker.ts +0 -188
- package/src/git/commit-helper.test.ts +0 -261
- package/src/git/commit-helper.ts +0 -329
- package/src/git/index.ts +0 -12
- package/src/git/pr-helper.test.ts +0 -284
- package/src/git/pr-helper.ts +0 -307
- package/src/index.ts +0 -76
- package/src/keywords/ai-keyword-engine.ts +0 -1062
- package/src/keywords/ai-summarizer.ts +0 -387
- package/src/keywords/ci-mode.ts +0 -555
- package/src/keywords/engine.ts +0 -359
- package/src/keywords/index.ts +0 -151
- package/src/keywords/llm-judge.ts +0 -357
- package/src/keywords/nlp-analysis.ts +0 -706
- package/src/keywords/prioritizer.ts +0 -295
- package/src/keywords/site-crawler.ts +0 -342
- package/src/keywords/sources/autocomplete.ts +0 -139
- package/src/keywords/sources/competitive-search.ts +0 -450
- package/src/keywords/sources/competitor-analysis.ts +0 -374
- package/src/keywords/sources/dataforseo.ts +0 -206
- package/src/keywords/sources/free-sources.ts +0 -294
- package/src/keywords/sources/gsc.ts +0 -123
- package/src/keywords/topic-grouping.ts +0 -327
- package/src/keywords/types.ts +0 -144
- package/src/keywords/wizard.ts +0 -457
- package/src/loader.ts +0 -40
- package/src/ranking/index.ts +0 -5
- package/src/ranking/serp-client.ts +0 -348
- package/src/ranking/tracker.ts +0 -380
- package/src/ranking/types.ts +0 -123
- package/src/reports/index.ts +0 -7
- package/src/reports/report-generator.test.ts +0 -293
- package/src/reports/report-generator.ts +0 -713
- package/src/scheduler/alerts.test.ts +0 -458
- package/src/scheduler/alerts.ts +0 -328
- package/src/scheduler/index.ts +0 -8
- package/src/scheduler/scheduled-audit.test.ts +0 -377
- package/src/scheduler/scheduled-audit.ts +0 -149
- package/src/test/integration-test.ts +0 -325
- package/src/tools/analyzer.ts +0 -373
- package/src/tools/crawl.ts +0 -293
- package/src/tools/files.ts +0 -301
- package/src/tools/h1-fixer.ts +0 -249
- package/src/tools/index.ts +0 -67
- package/src/tracking/github-action.ts +0 -326
- package/src/tracking/google-analytics.ts +0 -265
- package/src/tracking/index.ts +0 -45
- package/src/tracking/report-generator.ts +0 -386
- package/src/tracking/search-console.ts +0 -335
- package/src/types.ts +0 -148
- package/src/utils/http.ts +0 -302
- package/src/wasm-adapter.ts +0 -297
- package/src/wasm-entry.ts +0 -14
- package/tsconfig.json +0 -17
- package/tsup.wasm.config.ts +0 -26
- package/vitest.config.ts +0 -15
package/src/frameworks/index.ts
DELETED
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Framework Detection and SEO Recipes
|
|
3
|
-
*
|
|
4
|
-
* Provides framework-specific SEO suggestions for:
|
|
5
|
-
* - React, Next.js, Gatsby, Remix
|
|
6
|
-
* - Vue, Nuxt
|
|
7
|
-
* - Angular
|
|
8
|
-
* - Svelte, SvelteKit
|
|
9
|
-
* - Astro
|
|
10
|
-
* - Ruby on Rails
|
|
11
|
-
* - Laravel, Django
|
|
12
|
-
* - WordPress
|
|
13
|
-
*
|
|
14
|
-
* Usage:
|
|
15
|
-
*
|
|
16
|
-
* ```typescript
|
|
17
|
-
* import { detectFramework, getFrameworkIssues } from './frameworks';
|
|
18
|
-
*
|
|
19
|
-
* // Detect framework from HTML
|
|
20
|
-
* const frameworkInfo = detectFramework({ html });
|
|
21
|
-
*
|
|
22
|
-
* // Get framework-specific issues
|
|
23
|
-
* const issues = await getFrameworkIssues(frameworkInfo, html, url);
|
|
24
|
-
* ```
|
|
25
|
-
*/
|
|
26
|
-
|
|
27
|
-
export {
|
|
28
|
-
type Framework,
|
|
29
|
-
type FrameworkInfo,
|
|
30
|
-
detectFramework,
|
|
31
|
-
detectFromHtml,
|
|
32
|
-
detectFromPackageJson,
|
|
33
|
-
detectFromHeaders,
|
|
34
|
-
getFrameworkDisplayName,
|
|
35
|
-
} from './detector.js';
|
|
36
|
-
|
|
37
|
-
export {
|
|
38
|
-
type FrameworkCheck,
|
|
39
|
-
type FrameworkRecipe,
|
|
40
|
-
loadRecipe,
|
|
41
|
-
getFrameworkIssues,
|
|
42
|
-
getFrameworkSuggestions,
|
|
43
|
-
getFrameworkChecks,
|
|
44
|
-
getPerformanceTips,
|
|
45
|
-
getSeoChallenges,
|
|
46
|
-
getMigrationPaths,
|
|
47
|
-
getTotalFrameworkChecks,
|
|
48
|
-
getFrameworkSummary,
|
|
49
|
-
embedRecipe,
|
|
50
|
-
} from './suggestion-engine.js';
|
|
51
|
-
|
|
52
|
-
// Convenience function to get all available frameworks
|
|
53
|
-
export const SUPPORTED_FRAMEWORKS = [
|
|
54
|
-
'react',
|
|
55
|
-
'nextjs',
|
|
56
|
-
'vue',
|
|
57
|
-
'nuxt',
|
|
58
|
-
'angular',
|
|
59
|
-
'svelte',
|
|
60
|
-
'sveltekit',
|
|
61
|
-
'astro',
|
|
62
|
-
'remix',
|
|
63
|
-
'gatsby',
|
|
64
|
-
'rails',
|
|
65
|
-
'laravel',
|
|
66
|
-
'django',
|
|
67
|
-
'wordpress',
|
|
68
|
-
] as const;
|
|
@@ -1,171 +0,0 @@
|
|
|
1
|
-
# Angular SEO Recipe
|
|
2
|
-
# Angular has SSR support via Angular Universal
|
|
3
|
-
|
|
4
|
-
framework: angular
|
|
5
|
-
display_name: Angular
|
|
6
|
-
category: spa
|
|
7
|
-
ssr_default: false
|
|
8
|
-
|
|
9
|
-
seo_challenges:
|
|
10
|
-
- "Client-side rendering by default"
|
|
11
|
-
- "Heavy initial bundle size"
|
|
12
|
-
- "Complex SSR setup (Angular Universal)"
|
|
13
|
-
- "Zone.js can cause performance issues"
|
|
14
|
-
|
|
15
|
-
checks:
|
|
16
|
-
- code: ANGULAR_NO_UNIVERSAL
|
|
17
|
-
severity: error
|
|
18
|
-
title: "Angular app without Universal (SSR)"
|
|
19
|
-
description: "Client-side Angular apps send empty HTML to crawlers."
|
|
20
|
-
impact: "Your content may not be indexed by search engines"
|
|
21
|
-
howToFix: |
|
|
22
|
-
Add Angular Universal for SSR:
|
|
23
|
-
|
|
24
|
-
```bash
|
|
25
|
-
ng add @angular/ssr
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
This adds server-side rendering to your Angular app.
|
|
29
|
-
|
|
30
|
-
- code: ANGULAR_NO_TITLE_SERVICE
|
|
31
|
-
severity: error
|
|
32
|
-
title: "Not using Title/Meta services"
|
|
33
|
-
description: "Angular has built-in services for managing title and meta tags."
|
|
34
|
-
howToFix: |
|
|
35
|
-
Use Title and Meta services:
|
|
36
|
-
|
|
37
|
-
```ts
|
|
38
|
-
import { Title, Meta } from '@angular/platform-browser';
|
|
39
|
-
|
|
40
|
-
@Component({...})
|
|
41
|
-
export class ProductComponent {
|
|
42
|
-
constructor(
|
|
43
|
-
private title: Title,
|
|
44
|
-
private meta: Meta
|
|
45
|
-
) {}
|
|
46
|
-
|
|
47
|
-
ngOnInit() {
|
|
48
|
-
this.title.setTitle('Product Name | Your Site');
|
|
49
|
-
this.meta.updateTag({ name: 'description', content: 'Product description' });
|
|
50
|
-
this.meta.updateTag({ property: 'og:title', content: 'Product Name' });
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
- code: ANGULAR_LAZY_LOAD_MISSING
|
|
56
|
-
severity: warning
|
|
57
|
-
title: "Routes not lazy loaded"
|
|
58
|
-
description: "Loading all modules upfront increases initial bundle size."
|
|
59
|
-
howToFix: |
|
|
60
|
-
Use lazy loading for routes:
|
|
61
|
-
|
|
62
|
-
```ts
|
|
63
|
-
const routes: Routes = [
|
|
64
|
-
{
|
|
65
|
-
path: 'products',
|
|
66
|
-
loadChildren: () => import('./products/products.module')
|
|
67
|
-
.then(m => m.ProductsModule)
|
|
68
|
-
},
|
|
69
|
-
// Or with standalone components
|
|
70
|
-
{
|
|
71
|
-
path: 'about',
|
|
72
|
-
loadComponent: () => import('./about/about.component')
|
|
73
|
-
.then(m => m.AboutComponent)
|
|
74
|
-
}
|
|
75
|
-
];
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
- code: ANGULAR_PRERENDER_MISSING
|
|
79
|
-
severity: warning
|
|
80
|
-
title: "Static routes not prerendered"
|
|
81
|
-
description: "Static pages should be prerendered at build time."
|
|
82
|
-
howToFix: |
|
|
83
|
-
Configure prerendering in angular.json:
|
|
84
|
-
|
|
85
|
-
```json
|
|
86
|
-
{
|
|
87
|
-
"projects": {
|
|
88
|
-
"your-app": {
|
|
89
|
-
"architect": {
|
|
90
|
-
"prerender": {
|
|
91
|
-
"options": {
|
|
92
|
-
"routes": ["/", "/about", "/contact"]
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
```
|
|
100
|
-
|
|
101
|
-
Run: `ng run your-app:prerender`
|
|
102
|
-
|
|
103
|
-
- code: ANGULAR_CHANGE_DETECTION
|
|
104
|
-
severity: notice
|
|
105
|
-
title: "Using default change detection"
|
|
106
|
-
description: "OnPush change detection improves performance significantly."
|
|
107
|
-
howToFix: |
|
|
108
|
-
Use OnPush for components:
|
|
109
|
-
|
|
110
|
-
```ts
|
|
111
|
-
@Component({
|
|
112
|
-
selector: 'app-product',
|
|
113
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
114
|
-
template: `...`
|
|
115
|
-
})
|
|
116
|
-
export class ProductComponent {}
|
|
117
|
-
```
|
|
118
|
-
|
|
119
|
-
- code: ANGULAR_LARGE_BUNDLE
|
|
120
|
-
severity: warning
|
|
121
|
-
title: "Large initial bundle detected"
|
|
122
|
-
description: "Bundle over 500KB significantly hurts performance."
|
|
123
|
-
howToFix: |
|
|
124
|
-
1. Enable build optimizer:
|
|
125
|
-
```json
|
|
126
|
-
// angular.json
|
|
127
|
-
"optimization": true,
|
|
128
|
-
"buildOptimizer": true
|
|
129
|
-
```
|
|
130
|
-
|
|
131
|
-
2. Analyze bundle:
|
|
132
|
-
```bash
|
|
133
|
-
ng build --stats-json
|
|
134
|
-
npx webpack-bundle-analyzer dist/your-app/stats.json
|
|
135
|
-
```
|
|
136
|
-
|
|
137
|
-
3. Remove unused dependencies
|
|
138
|
-
|
|
139
|
-
- code: ANGULAR_NO_IMAGE_DIRECTIVE
|
|
140
|
-
severity: notice
|
|
141
|
-
title: "Not using NgOptimizedImage"
|
|
142
|
-
description: "Angular 15+ has built-in image optimization."
|
|
143
|
-
howToFix: |
|
|
144
|
-
Use NgOptimizedImage directive:
|
|
145
|
-
|
|
146
|
-
```ts
|
|
147
|
-
import { NgOptimizedImage } from '@angular/common';
|
|
148
|
-
|
|
149
|
-
@Component({
|
|
150
|
-
imports: [NgOptimizedImage],
|
|
151
|
-
template: `
|
|
152
|
-
<img ngSrc="/hero.jpg" width="1200" height="630" priority />
|
|
153
|
-
`
|
|
154
|
-
})
|
|
155
|
-
```
|
|
156
|
-
|
|
157
|
-
performance_tips:
|
|
158
|
-
- "Use standalone components to reduce bundle"
|
|
159
|
-
- "Enable OnPush change detection"
|
|
160
|
-
- "Lazy load routes"
|
|
161
|
-
- "Use trackBy with ngFor"
|
|
162
|
-
- "Prerender static pages"
|
|
163
|
-
|
|
164
|
-
migration_paths:
|
|
165
|
-
analog:
|
|
166
|
-
effort: medium
|
|
167
|
-
benefits:
|
|
168
|
-
- "File-based routing"
|
|
169
|
-
- "Full SSR support"
|
|
170
|
-
- "Vite-powered builds"
|
|
171
|
-
guide: "https://analogjs.org/docs/introduction"
|
|
@@ -1,206 +0,0 @@
|
|
|
1
|
-
# Astro SEO Recipe
|
|
2
|
-
# Astro is SEO-first by design - zero JS by default, excellent for content sites
|
|
3
|
-
|
|
4
|
-
framework: astro
|
|
5
|
-
display_name: Astro
|
|
6
|
-
category: static-first
|
|
7
|
-
ssr_default: false # Static by default, SSR optional
|
|
8
|
-
|
|
9
|
-
seo_strengths:
|
|
10
|
-
- "Zero JavaScript by default"
|
|
11
|
-
- "Static HTML output"
|
|
12
|
-
- "Excellent performance (100 Lighthouse)"
|
|
13
|
-
- "Content Collections for organized content"
|
|
14
|
-
- "Built-in sitemap and RSS integrations"
|
|
15
|
-
- "Partial hydration (Islands Architecture)"
|
|
16
|
-
|
|
17
|
-
checks:
|
|
18
|
-
- code: ASTRO_NO_SITEMAP
|
|
19
|
-
severity: warning
|
|
20
|
-
title: "Missing sitemap integration"
|
|
21
|
-
description: "Astro has a built-in sitemap integration."
|
|
22
|
-
howToFix: |
|
|
23
|
-
Add the sitemap integration:
|
|
24
|
-
|
|
25
|
-
```bash
|
|
26
|
-
npx astro add sitemap
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
Configure in astro.config.mjs:
|
|
30
|
-
```js
|
|
31
|
-
import sitemap from '@astrojs/sitemap';
|
|
32
|
-
|
|
33
|
-
export default defineConfig({
|
|
34
|
-
site: 'https://yoursite.com',
|
|
35
|
-
integrations: [sitemap()],
|
|
36
|
-
});
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
- code: ASTRO_NO_SITE_CONFIG
|
|
40
|
-
severity: error
|
|
41
|
-
title: "Missing site URL configuration"
|
|
42
|
-
description: "The site URL is required for sitemap and canonical URLs."
|
|
43
|
-
howToFix: |
|
|
44
|
-
Add site to astro.config.mjs:
|
|
45
|
-
|
|
46
|
-
```js
|
|
47
|
-
export default defineConfig({
|
|
48
|
-
site: 'https://yoursite.com',
|
|
49
|
-
});
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
- code: ASTRO_CLIENT_DIRECTIVE_OVERUSE
|
|
53
|
-
severity: warning
|
|
54
|
-
title: "Overusing client: directives"
|
|
55
|
-
description: "Too many client-side components reduce Astro's performance benefits."
|
|
56
|
-
howToFix: |
|
|
57
|
-
Only hydrate components that need interactivity:
|
|
58
|
-
|
|
59
|
-
```astro
|
|
60
|
-
<!-- Bad - unnecessary JS -->
|
|
61
|
-
<StaticCard client:load />
|
|
62
|
-
|
|
63
|
-
<!-- Good - no JS for static content -->
|
|
64
|
-
<StaticCard />
|
|
65
|
-
|
|
66
|
-
<!-- Good - only hydrate when needed -->
|
|
67
|
-
<InteractiveWidget client:visible />
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
Prefer client:visible over client:load for below-fold content.
|
|
71
|
-
|
|
72
|
-
- code: ASTRO_NO_BASE_LAYOUT
|
|
73
|
-
severity: notice
|
|
74
|
-
title: "Pages missing base layout"
|
|
75
|
-
description: "Using a shared layout ensures consistent SEO tags."
|
|
76
|
-
howToFix: |
|
|
77
|
-
Create a BaseLayout.astro:
|
|
78
|
-
|
|
79
|
-
```astro
|
|
80
|
-
---
|
|
81
|
-
// src/layouts/BaseLayout.astro
|
|
82
|
-
interface Props {
|
|
83
|
-
title: string;
|
|
84
|
-
description: string;
|
|
85
|
-
}
|
|
86
|
-
const { title, description } = Astro.props;
|
|
87
|
-
---
|
|
88
|
-
<html lang="en">
|
|
89
|
-
<head>
|
|
90
|
-
<meta charset="UTF-8" />
|
|
91
|
-
<meta name="viewport" content="width=device-width" />
|
|
92
|
-
<title>{title}</title>
|
|
93
|
-
<meta name="description" content={description} />
|
|
94
|
-
<link rel="canonical" href={Astro.url} />
|
|
95
|
-
</head>
|
|
96
|
-
<body>
|
|
97
|
-
<slot />
|
|
98
|
-
</body>
|
|
99
|
-
</html>
|
|
100
|
-
```
|
|
101
|
-
|
|
102
|
-
- code: ASTRO_NO_ASTRO_SEO
|
|
103
|
-
severity: notice
|
|
104
|
-
title: "Not using @astrolib/seo"
|
|
105
|
-
description: "The astro-seo package provides comprehensive SEO components."
|
|
106
|
-
howToFix: |
|
|
107
|
-
Install astro-seo:
|
|
108
|
-
|
|
109
|
-
```bash
|
|
110
|
-
npm install astro-seo
|
|
111
|
-
```
|
|
112
|
-
|
|
113
|
-
```astro
|
|
114
|
-
---
|
|
115
|
-
import { SEO } from 'astro-seo';
|
|
116
|
-
---
|
|
117
|
-
<SEO
|
|
118
|
-
title="Page Title"
|
|
119
|
-
description="Description"
|
|
120
|
-
openGraph={{
|
|
121
|
-
basic: {
|
|
122
|
-
title: "OG Title",
|
|
123
|
-
type: "website",
|
|
124
|
-
image: "/og-image.jpg",
|
|
125
|
-
}
|
|
126
|
-
}}
|
|
127
|
-
twitter={{
|
|
128
|
-
creator: "@handle"
|
|
129
|
-
}}
|
|
130
|
-
/>
|
|
131
|
-
```
|
|
132
|
-
|
|
133
|
-
- code: ASTRO_IMAGE_NOT_OPTIMIZED
|
|
134
|
-
severity: warning
|
|
135
|
-
title: "Images not using Astro Image"
|
|
136
|
-
description: "Use Astro's built-in Image component for optimization."
|
|
137
|
-
howToFix: |
|
|
138
|
-
Use the Image component:
|
|
139
|
-
|
|
140
|
-
```astro
|
|
141
|
-
---
|
|
142
|
-
import { Image } from 'astro:assets';
|
|
143
|
-
import heroImage from '../assets/hero.jpg';
|
|
144
|
-
---
|
|
145
|
-
<Image
|
|
146
|
-
src={heroImage}
|
|
147
|
-
alt="Hero"
|
|
148
|
-
width={1200}
|
|
149
|
-
height={630}
|
|
150
|
-
loading="eager"
|
|
151
|
-
/>
|
|
152
|
-
```
|
|
153
|
-
|
|
154
|
-
- code: ASTRO_NO_CONTENT_COLLECTIONS
|
|
155
|
-
severity: notice
|
|
156
|
-
title: "Not using Content Collections"
|
|
157
|
-
description: "Content Collections provide type-safe content with built-in frontmatter validation."
|
|
158
|
-
howToFix: |
|
|
159
|
-
Define a collection in src/content/config.ts:
|
|
160
|
-
|
|
161
|
-
```ts
|
|
162
|
-
import { defineCollection, z } from 'astro:content';
|
|
163
|
-
|
|
164
|
-
const blog = defineCollection({
|
|
165
|
-
schema: z.object({
|
|
166
|
-
title: z.string(),
|
|
167
|
-
description: z.string(),
|
|
168
|
-
pubDate: z.date(),
|
|
169
|
-
}),
|
|
170
|
-
});
|
|
171
|
-
|
|
172
|
-
export const collections = { blog };
|
|
173
|
-
```
|
|
174
|
-
|
|
175
|
-
- code: ASTRO_SSR_OVERUSE
|
|
176
|
-
severity: notice
|
|
177
|
-
title: "Using SSR when static would work"
|
|
178
|
-
description: "Static pages are faster and cheaper to host."
|
|
179
|
-
howToFix: |
|
|
180
|
-
Use prerender for pages that don't need SSR:
|
|
181
|
-
|
|
182
|
-
```astro
|
|
183
|
-
---
|
|
184
|
-
export const prerender = true; // Static generation
|
|
185
|
-
---
|
|
186
|
-
```
|
|
187
|
-
|
|
188
|
-
Or set default to static in config:
|
|
189
|
-
```js
|
|
190
|
-
export default defineConfig({
|
|
191
|
-
output: 'hybrid', // Static by default, SSR opt-in
|
|
192
|
-
});
|
|
193
|
-
```
|
|
194
|
-
|
|
195
|
-
performance_tips:
|
|
196
|
-
- "Use client:visible instead of client:load for below-fold components"
|
|
197
|
-
- "Leverage Content Collections for type-safe content"
|
|
198
|
-
- "Use View Transitions for smooth navigation"
|
|
199
|
-
- "Optimize images with astro:assets"
|
|
200
|
-
- "Consider using Astro DB for dynamic content"
|
|
201
|
-
|
|
202
|
-
integrations:
|
|
203
|
-
- "@astrojs/sitemap - Automatic sitemap generation"
|
|
204
|
-
- "@astrojs/rss - RSS feed for blogs"
|
|
205
|
-
- "astro-seo - Comprehensive SEO component"
|
|
206
|
-
- "@astrojs/partytown - Move third-party scripts to web worker"
|
|
@@ -1,180 +0,0 @@
|
|
|
1
|
-
# Django SEO Recipe
|
|
2
|
-
# Django is the most popular Python web framework
|
|
3
|
-
|
|
4
|
-
framework: django
|
|
5
|
-
display_name: Django
|
|
6
|
-
category: server-rendered
|
|
7
|
-
ssr_default: true
|
|
8
|
-
|
|
9
|
-
seo_strengths:
|
|
10
|
-
- "Server-rendered HTML by default"
|
|
11
|
-
- "Built-in sitemap framework"
|
|
12
|
-
- "Admin interface for content management"
|
|
13
|
-
- "Mature ecosystem"
|
|
14
|
-
|
|
15
|
-
checks:
|
|
16
|
-
- code: DJANGO_NO_SITEMAP
|
|
17
|
-
severity: warning
|
|
18
|
-
title: "Django sitemap framework not configured"
|
|
19
|
-
description: "Django has a built-in sitemap framework that should be used."
|
|
20
|
-
howToFix: |
|
|
21
|
-
Add sitemap to your project:
|
|
22
|
-
|
|
23
|
-
```python
|
|
24
|
-
# settings.py
|
|
25
|
-
INSTALLED_APPS = [
|
|
26
|
-
'django.contrib.sitemaps',
|
|
27
|
-
]
|
|
28
|
-
|
|
29
|
-
# sitemaps.py
|
|
30
|
-
from django.contrib.sitemaps import Sitemap
|
|
31
|
-
from .models import Post
|
|
32
|
-
|
|
33
|
-
class PostSitemap(Sitemap):
|
|
34
|
-
changefreq = "weekly"
|
|
35
|
-
priority = 0.8
|
|
36
|
-
|
|
37
|
-
def items(self):
|
|
38
|
-
return Post.objects.filter(published=True)
|
|
39
|
-
|
|
40
|
-
def lastmod(self, obj):
|
|
41
|
-
return obj.updated_at
|
|
42
|
-
|
|
43
|
-
# urls.py
|
|
44
|
-
from django.contrib.sitemaps.views import sitemap
|
|
45
|
-
from .sitemaps import PostSitemap
|
|
46
|
-
|
|
47
|
-
sitemaps = {'posts': PostSitemap}
|
|
48
|
-
|
|
49
|
-
urlpatterns = [
|
|
50
|
-
path('sitemap.xml', sitemap, {'sitemaps': sitemaps}),
|
|
51
|
-
]
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
- code: DJANGO_NO_META_FRAMEWORK
|
|
55
|
-
severity: warning
|
|
56
|
-
title: "No SEO meta framework detected"
|
|
57
|
-
description: "Use django-meta for consistent meta tag management."
|
|
58
|
-
howToFix: |
|
|
59
|
-
Install django-meta:
|
|
60
|
-
|
|
61
|
-
```bash
|
|
62
|
-
pip install django-meta
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
```python
|
|
66
|
-
# settings.py
|
|
67
|
-
INSTALLED_APPS = ['meta']
|
|
68
|
-
|
|
69
|
-
META_SITE_PROTOCOL = 'https'
|
|
70
|
-
META_USE_OG_PROPERTIES = True
|
|
71
|
-
META_USE_TWITTER_PROPERTIES = True
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
```python
|
|
75
|
-
# In views or models
|
|
76
|
-
from meta.views import MetadataMixin
|
|
77
|
-
|
|
78
|
-
class PostDetailView(MetadataMixin, DetailView):
|
|
79
|
-
def get_meta_title(self):
|
|
80
|
-
return self.object.title
|
|
81
|
-
|
|
82
|
-
def get_meta_description(self):
|
|
83
|
-
return self.object.excerpt
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
- code: DJANGO_DEBUG_TRUE
|
|
87
|
-
severity: error
|
|
88
|
-
title: "DEBUG mode appears enabled"
|
|
89
|
-
description: "DEBUG=True in production exposes sensitive information and hurts performance."
|
|
90
|
-
howToFix: |
|
|
91
|
-
Ensure DEBUG is False in production:
|
|
92
|
-
|
|
93
|
-
```python
|
|
94
|
-
# settings.py
|
|
95
|
-
DEBUG = os.environ.get('DEBUG', 'False') == 'True'
|
|
96
|
-
```
|
|
97
|
-
|
|
98
|
-
Or use django-environ:
|
|
99
|
-
```python
|
|
100
|
-
import environ
|
|
101
|
-
env = environ.Env(DEBUG=(bool, False))
|
|
102
|
-
DEBUG = env('DEBUG')
|
|
103
|
-
```
|
|
104
|
-
|
|
105
|
-
- code: DJANGO_NO_CACHE
|
|
106
|
-
severity: warning
|
|
107
|
-
title: "Caching not configured"
|
|
108
|
-
description: "Django without caching is slower than it should be."
|
|
109
|
-
howToFix: |
|
|
110
|
-
Configure caching in settings.py:
|
|
111
|
-
|
|
112
|
-
```python
|
|
113
|
-
# Redis (recommended)
|
|
114
|
-
CACHES = {
|
|
115
|
-
'default': {
|
|
116
|
-
'BACKEND': 'django.core.cache.backends.redis.RedisCache',
|
|
117
|
-
'LOCATION': 'redis://127.0.0.1:6379',
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
# Use cache in views
|
|
122
|
-
from django.views.decorators.cache import cache_page
|
|
123
|
-
|
|
124
|
-
@cache_page(60 * 15) # 15 minutes
|
|
125
|
-
def my_view(request):
|
|
126
|
-
...
|
|
127
|
-
```
|
|
128
|
-
|
|
129
|
-
- code: DJANGO_NO_GZIP
|
|
130
|
-
severity: notice
|
|
131
|
-
title: "GZip middleware not enabled"
|
|
132
|
-
description: "Enable GZip compression for faster page loads."
|
|
133
|
-
howToFix: |
|
|
134
|
-
Add GZip middleware:
|
|
135
|
-
|
|
136
|
-
```python
|
|
137
|
-
# settings.py
|
|
138
|
-
MIDDLEWARE = [
|
|
139
|
-
'django.middleware.gzip.GZipMiddleware',
|
|
140
|
-
# ... other middleware
|
|
141
|
-
]
|
|
142
|
-
```
|
|
143
|
-
|
|
144
|
-
- code: DJANGO_NO_WHITENOISE
|
|
145
|
-
severity: notice
|
|
146
|
-
title: "Static files not optimized"
|
|
147
|
-
description: "Use WhiteNoise for efficient static file serving."
|
|
148
|
-
howToFix: |
|
|
149
|
-
Install and configure WhiteNoise:
|
|
150
|
-
|
|
151
|
-
```bash
|
|
152
|
-
pip install whitenoise
|
|
153
|
-
```
|
|
154
|
-
|
|
155
|
-
```python
|
|
156
|
-
# settings.py
|
|
157
|
-
MIDDLEWARE = [
|
|
158
|
-
'django.middleware.security.SecurityMiddleware',
|
|
159
|
-
'whitenoise.middleware.WhiteNoiseMiddleware',
|
|
160
|
-
# ...
|
|
161
|
-
]
|
|
162
|
-
|
|
163
|
-
STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'
|
|
164
|
-
```
|
|
165
|
-
|
|
166
|
-
performance_tips:
|
|
167
|
-
- "Use select_related/prefetch_related for queries"
|
|
168
|
-
- "Enable template caching in production"
|
|
169
|
-
- "Use django-debug-toolbar in development"
|
|
170
|
-
- "Configure database connection pooling"
|
|
171
|
-
- "Use async views for I/O-bound operations (Django 4.1+)"
|
|
172
|
-
|
|
173
|
-
recommended_packages:
|
|
174
|
-
seo:
|
|
175
|
-
- "django-meta - Meta tag management"
|
|
176
|
-
- "django-robots - robots.txt management"
|
|
177
|
-
performance:
|
|
178
|
-
- "django-redis - Redis caching"
|
|
179
|
-
- "whitenoise - Static file serving"
|
|
180
|
-
- "django-debug-toolbar - Development profiling"
|