@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.
Files changed (202) hide show
  1. package/dist/index.d.mts +43 -393
  2. package/dist/index.d.ts +43 -393
  3. package/dist/index.js +306 -6526
  4. package/dist/index.mjs +202 -6412
  5. package/package.json +6 -1
  6. package/scripts/build-deno.ts +0 -134
  7. package/src/analyzers/core-web-vitals-analyzer.test.ts +0 -236
  8. package/src/analyzers/core-web-vitals-analyzer.ts +0 -557
  9. package/src/analyzers/geo-analyzer.test.ts +0 -310
  10. package/src/analyzers/geo-analyzer.ts +0 -814
  11. package/src/analyzers/image-optimization-analyzer.test.ts +0 -145
  12. package/src/analyzers/image-optimization-analyzer.ts +0 -348
  13. package/src/analyzers/index.ts +0 -233
  14. package/src/analyzers/internal-linking-analyzer.test.ts +0 -141
  15. package/src/analyzers/internal-linking-analyzer.ts +0 -419
  16. package/src/analyzers/mobile-seo-analyzer.test.ts +0 -140
  17. package/src/analyzers/mobile-seo-analyzer.ts +0 -455
  18. package/src/analyzers/security-headers-analyzer.test.ts +0 -115
  19. package/src/analyzers/security-headers-analyzer.ts +0 -318
  20. package/src/analyzers/structured-data-analyzer.test.ts +0 -210
  21. package/src/analyzers/structured-data-analyzer.ts +0 -590
  22. package/src/audit/ai/analyzer.ts +0 -347
  23. package/src/audit/ai/index.ts +0 -29
  24. package/src/audit/ai/prompts/content-analysis.ts +0 -271
  25. package/src/audit/ai/types.ts +0 -179
  26. package/src/audit/checks/additional-checks.ts +0 -439
  27. package/src/audit/checks/agent-experience.ts +0 -108
  28. package/src/audit/checks/ai-citation-worthiness.ts +0 -399
  29. package/src/audit/checks/ai-content-structure.ts +0 -325
  30. package/src/audit/checks/ai-readiness.ts +0 -406
  31. package/src/audit/checks/anchor-text.ts +0 -179
  32. package/src/audit/checks/answer-conciseness.ts +0 -322
  33. package/src/audit/checks/asset-minification.ts +0 -270
  34. package/src/audit/checks/bing-optimization.ts +0 -206
  35. package/src/audit/checks/brand-mention-optimization.ts +0 -349
  36. package/src/audit/checks/caching-headers.ts +0 -305
  37. package/src/audit/checks/canonical-advanced.ts +0 -150
  38. package/src/audit/checks/canonical-domain.ts +0 -196
  39. package/src/audit/checks/citation-quality.ts +0 -358
  40. package/src/audit/checks/client-rendering.ts +0 -542
  41. package/src/audit/checks/color-contrast.ts +0 -342
  42. package/src/audit/checks/content-freshness.ts +0 -170
  43. package/src/audit/checks/content-science.ts +0 -589
  44. package/src/audit/checks/conversion-elements.ts +0 -526
  45. package/src/audit/checks/crawlability.ts +0 -220
  46. package/src/audit/checks/directory-listing.ts +0 -172
  47. package/src/audit/checks/dom-analysis.ts +0 -191
  48. package/src/audit/checks/dom-size.ts +0 -246
  49. package/src/audit/checks/duplicate-content.ts +0 -194
  50. package/src/audit/checks/eeat-signals.ts +0 -990
  51. package/src/audit/checks/entity-seo.ts +0 -396
  52. package/src/audit/checks/featured-snippet.ts +0 -473
  53. package/src/audit/checks/freshness-signals.ts +0 -443
  54. package/src/audit/checks/funnel-intent.ts +0 -463
  55. package/src/audit/checks/hreflang.ts +0 -174
  56. package/src/audit/checks/html-compliance.ts +0 -302
  57. package/src/audit/checks/image-dimensions.ts +0 -167
  58. package/src/audit/checks/images.ts +0 -160
  59. package/src/audit/checks/indexnow.ts +0 -275
  60. package/src/audit/checks/interactive-tools.ts +0 -475
  61. package/src/audit/checks/internal-link-graph.ts +0 -436
  62. package/src/audit/checks/keyword-analysis.ts +0 -239
  63. package/src/audit/checks/keyword-cannibalization.ts +0 -385
  64. package/src/audit/checks/keyword-placement.ts +0 -471
  65. package/src/audit/checks/links.ts +0 -273
  66. package/src/audit/checks/llms-txt.ts +0 -224
  67. package/src/audit/checks/local-seo.ts +0 -296
  68. package/src/audit/checks/mobile.ts +0 -167
  69. package/src/audit/checks/modern-images.ts +0 -226
  70. package/src/audit/checks/navboost-signals.ts +0 -395
  71. package/src/audit/checks/on-page.ts +0 -209
  72. package/src/audit/checks/page-resources.ts +0 -285
  73. package/src/audit/checks/pagination.ts +0 -180
  74. package/src/audit/checks/performance.ts +0 -153
  75. package/src/audit/checks/platform-presence.ts +0 -580
  76. package/src/audit/checks/rag-chunk-readiness.test.ts +0 -159
  77. package/src/audit/checks/rag-chunk-readiness.ts +0 -163
  78. package/src/audit/checks/redirect-analysis.ts +0 -153
  79. package/src/audit/checks/redirect-chain.ts +0 -389
  80. package/src/audit/checks/resource-hints.ts +0 -420
  81. package/src/audit/checks/responsive-css.ts +0 -247
  82. package/src/audit/checks/responsive-images.ts +0 -396
  83. package/src/audit/checks/review-ecosystem.ts +0 -415
  84. package/src/audit/checks/robots-validation.ts +0 -373
  85. package/src/audit/checks/security-headers.ts +0 -188
  86. package/src/audit/checks/security.ts +0 -144
  87. package/src/audit/checks/serp-preview.ts +0 -251
  88. package/src/audit/checks/site-maturity.ts +0 -453
  89. package/src/audit/checks/social-meta.test.ts +0 -275
  90. package/src/audit/checks/social-meta.ts +0 -134
  91. package/src/audit/checks/soft-404.ts +0 -151
  92. package/src/audit/checks/structured-data.ts +0 -238
  93. package/src/audit/checks/tech-detection.ts +0 -496
  94. package/src/audit/checks/topical-clusters.ts +0 -435
  95. package/src/audit/checks/tracker-bloat.ts +0 -462
  96. package/src/audit/checks/tracking-verification.test.ts +0 -371
  97. package/src/audit/checks/tracking-verification.ts +0 -636
  98. package/src/audit/checks/url-safety.ts +0 -682
  99. package/src/audit/deno-entry.ts +0 -66
  100. package/src/audit/discovery/index.ts +0 -15
  101. package/src/audit/discovery/link-crawler.ts +0 -233
  102. package/src/audit/discovery/repo-routes.ts +0 -347
  103. package/src/audit/engine.ts +0 -633
  104. package/src/audit/fixes/index.ts +0 -209
  105. package/src/audit/fixes/social-meta-fixes.test.ts +0 -329
  106. package/src/audit/fixes/social-meta-fixes.ts +0 -463
  107. package/src/audit/index.ts +0 -74
  108. package/src/audit/runner.test.ts +0 -299
  109. package/src/audit/runner.ts +0 -130
  110. package/src/audit/types.ts +0 -1987
  111. package/src/content/featured-snippet.ts +0 -367
  112. package/src/content/generator.test.ts +0 -534
  113. package/src/content/generator.ts +0 -501
  114. package/src/content/headline.ts +0 -317
  115. package/src/content/index.ts +0 -62
  116. package/src/content/intent.ts +0 -258
  117. package/src/content/keyword-density.ts +0 -349
  118. package/src/content/readability.ts +0 -262
  119. package/src/executor.ts +0 -336
  120. package/src/fixer/framework-fixes.test.ts +0 -489
  121. package/src/fixer/framework-fixes.ts +0 -5287
  122. package/src/fixer/index.ts +0 -6
  123. package/src/fixer/schemas.ts +0 -971
  124. package/src/fixer.ts +0 -642
  125. package/src/frameworks/detector.test.ts +0 -248
  126. package/src/frameworks/detector.ts +0 -899
  127. package/src/frameworks/index.ts +0 -68
  128. package/src/frameworks/recipes/angular.yaml +0 -171
  129. package/src/frameworks/recipes/astro.yaml +0 -206
  130. package/src/frameworks/recipes/django.yaml +0 -180
  131. package/src/frameworks/recipes/laravel.yaml +0 -137
  132. package/src/frameworks/recipes/nextjs.yaml +0 -268
  133. package/src/frameworks/recipes/nuxt.yaml +0 -175
  134. package/src/frameworks/recipes/rails.yaml +0 -188
  135. package/src/frameworks/recipes/react.yaml +0 -202
  136. package/src/frameworks/recipes/sveltekit.yaml +0 -154
  137. package/src/frameworks/recipes/vue.yaml +0 -137
  138. package/src/frameworks/recipes/wordpress.yaml +0 -209
  139. package/src/frameworks/suggestion-engine.ts +0 -357
  140. package/src/geo/geo-content.test.ts +0 -305
  141. package/src/geo/geo-content.ts +0 -266
  142. package/src/geo/geo-history.test.ts +0 -473
  143. package/src/geo/geo-history.ts +0 -433
  144. package/src/geo/geo-tracker.test.ts +0 -359
  145. package/src/geo/geo-tracker.ts +0 -411
  146. package/src/geo/index.ts +0 -11
  147. package/src/geo/llm-citation-checker.ts +0 -188
  148. package/src/git/commit-helper.test.ts +0 -261
  149. package/src/git/commit-helper.ts +0 -329
  150. package/src/git/index.ts +0 -12
  151. package/src/git/pr-helper.test.ts +0 -284
  152. package/src/git/pr-helper.ts +0 -307
  153. package/src/index.ts +0 -76
  154. package/src/keywords/ai-keyword-engine.ts +0 -1062
  155. package/src/keywords/ai-summarizer.ts +0 -387
  156. package/src/keywords/ci-mode.ts +0 -555
  157. package/src/keywords/engine.ts +0 -359
  158. package/src/keywords/index.ts +0 -151
  159. package/src/keywords/llm-judge.ts +0 -357
  160. package/src/keywords/nlp-analysis.ts +0 -706
  161. package/src/keywords/prioritizer.ts +0 -295
  162. package/src/keywords/site-crawler.ts +0 -342
  163. package/src/keywords/sources/autocomplete.ts +0 -139
  164. package/src/keywords/sources/competitive-search.ts +0 -450
  165. package/src/keywords/sources/competitor-analysis.ts +0 -374
  166. package/src/keywords/sources/dataforseo.ts +0 -206
  167. package/src/keywords/sources/free-sources.ts +0 -294
  168. package/src/keywords/sources/gsc.ts +0 -123
  169. package/src/keywords/topic-grouping.ts +0 -327
  170. package/src/keywords/types.ts +0 -144
  171. package/src/keywords/wizard.ts +0 -457
  172. package/src/loader.ts +0 -40
  173. package/src/ranking/index.ts +0 -5
  174. package/src/ranking/serp-client.ts +0 -348
  175. package/src/ranking/tracker.ts +0 -380
  176. package/src/ranking/types.ts +0 -123
  177. package/src/reports/index.ts +0 -7
  178. package/src/reports/report-generator.test.ts +0 -293
  179. package/src/reports/report-generator.ts +0 -713
  180. package/src/scheduler/alerts.test.ts +0 -458
  181. package/src/scheduler/alerts.ts +0 -328
  182. package/src/scheduler/index.ts +0 -8
  183. package/src/scheduler/scheduled-audit.test.ts +0 -377
  184. package/src/scheduler/scheduled-audit.ts +0 -149
  185. package/src/test/integration-test.ts +0 -325
  186. package/src/tools/analyzer.ts +0 -373
  187. package/src/tools/crawl.ts +0 -293
  188. package/src/tools/files.ts +0 -301
  189. package/src/tools/h1-fixer.ts +0 -249
  190. package/src/tools/index.ts +0 -67
  191. package/src/tracking/github-action.ts +0 -326
  192. package/src/tracking/google-analytics.ts +0 -265
  193. package/src/tracking/index.ts +0 -45
  194. package/src/tracking/report-generator.ts +0 -386
  195. package/src/tracking/search-console.ts +0 -335
  196. package/src/types.ts +0 -148
  197. package/src/utils/http.ts +0 -302
  198. package/src/wasm-adapter.ts +0 -297
  199. package/src/wasm-entry.ts +0 -14
  200. package/tsconfig.json +0 -17
  201. package/tsup.wasm.config.ts +0 -26
  202. package/vitest.config.ts +0 -15
@@ -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"