Loading...
Loading...
Implement GEO in Vue.js with Nuxt.js SSR and static generation
Nuxt.js provides excellent support for GEO with server-side rendering and API routes
Set up the main GEO configuration endpoint
Implement the AI summary endpoint
1export default defineEventHandler(async (event) => {2 const summary = {3 version: "1.0",4 lastModified: new Date().toISOString(),5 summary: "Your Nuxt.js app provides [services] to [audience] with [benefits]. Built with Nuxt.js 3 and Vue 3 for optimal performance and SEO.",6 keyFeatures: [7 "Nuxt.js framework",8 "Vue 3",9 "Server API",10 "Auto-imports",11 "TypeScript support"12 ],13 targetAudience: [14 "Vue developers",15 "Full-stack developers",16 "Progressive web app developers"17 ],18 primaryUseCases: [19 "Progressive web apps",20 "SSR applications",21 "Static sites",22 "E-commerce"23 ]24 };2526 setHeader(event, 'Content-Type', 'application/json');27 setHeader(event, 'Cache-Control', 'public, max-age=86400, stale-while-revalidate=604800');2829 return summary;30});
Set up the AI crawler permissions endpoint
1export default defineEventHandler(async (event) => {2 const aiTxt = `# AI.txt for yoursite.com3# This file specifies which JSON endpoints are accessible to AI crawlers45User-agent: *6Allow: /ai/faq.json7Allow: /ai/service.json8Allow: /ai/summary.json910# Last updated: ${new Date().toISOString().split('T')[0]}`;1112 setHeader(event, 'Content-Type', 'text/plain; charset=utf-8');13 setHeader(event, 'Cache-Control', 'public, max-age=86400, stale-while-revalidate=604800');1415 return aiTxt;16});
Add frequently asked questions for AI systems
1export default defineEventHandler(async (event) => {2 const faq = {3 version: "1.0",4 lastModified: new Date().toISOString(),5 faqs: [6 {7 question: "What is this Nuxt.js app about?",8 answer: "This is a [service type] built with Nuxt.js that helps [audience] with [benefits]."9 },10 {11 question: "What technologies are used?",12 answer: "This app is built with Nuxt.js 3, Vue 3, TypeScript, and modern web standards."13 },14 {15 question: "How can I get started?",16 answer: "Visit our documentation or contact us for more information about our services."17 }18 ]19 };2021 setHeader(event, 'Content-Type', 'application/json');22 setHeader(event, 'Cache-Control', 'public, max-age=86400, stale-while-revalidate=604800');2324 return faq;25});
Define your service capabilities and endpoints
1export default defineEventHandler(async (event) => {2 const service = {3 version: "1.0",4 lastModified: new Date().toISOString(),5 service: {6 name: "Your Nuxt.js App",7 type: "web-application",8 description: "A modern web application built with Nuxt.js",9 url: "https://yoursite.com",10 capabilities: [11 "Server-side rendering",12 "Static generation",13 "API routes",14 "Auto-imports"15 ],16 endpoints: {17 "home": "/",18 "about": "/about",19 "contact": "/contact",20 "api": "/api"21 },22 supportedFrameworks: ["Nuxt.js", "Vue 3", "TypeScript"],23 contact: {24 "email": "contact@yoursite.com",25 "documentation": "https://yoursite.com/docs"26 },27 pricing: "free",28 availability: "24/7"29 }30 };3132 setHeader(event, 'Content-Type', 'application/json');33 setHeader(event, 'Cache-Control', 'public, max-age=86400, stale-while-revalidate=604800');3435 return service;36});
Set up general crawler permissions and AI crawler access
1export default defineEventHandler(async (event) => {2 const robots = `# Allow legitimate search engines and AI crawlers3User-agent: Googlebot4Allow: /56User-agent: Bingbot7Allow: /89User-agent: Slurp10Allow: /1112User-agent: DuckDuckBot13Allow: /1415User-agent: Baiduspider16Allow: /1718User-agent: YandexBot19Allow: /2021# Allow AI crawlers for GEO content22User-agent: GPTBot23Allow: /2425User-agent: ChatGPT-User26Allow: /2728User-agent: CCBot29Allow: /3031User-agent: anthropic-ai32Allow: /3334User-agent: Claude-Web35Allow: /3637# Allow social media crawlers38User-agent: facebookexternalhit39Allow: /4041User-agent: Twitterbot42Allow: /4344User-agent: LinkedInBot45Allow: /4647# Block suspicious bots and scrapers48User-agent: *49Disallow: /api/50Disallow: /_nuxt/51Disallow: /admin/52Disallow: /private/53Disallow: /*.json$54Disallow: /*?*5556# Block common bad bots57User-agent: AhrefsBot58Disallow: /5960User-agent: MJ12bot61Disallow: /6263User-agent: DotBot64Disallow: /6566User-agent: SemrushBot67Disallow: /6869User-agent: BLEXBot70Disallow: /7172User-agent: DataForSeoBot73Disallow: /7475User-agent: MegaIndex76Disallow: /7778User-agent: PetalBot79Disallow: /8081User-agent: AspiegelBot82Disallow: /8384User-agent: SeoCheckBot85Disallow: /8687User-agent: SeoBot88Disallow: /8990User-agent: SeobilityBot91Disallow: /9293User-agent: SiteAuditBot94Disallow: /9596User-agent: Siteimprove97Disallow: /9899User-agent: SiteLockSpider100Disallow: /101102User-agent: SiteSucker103Disallow: /104105User-agent: Sogou106Disallow: /107108User-agent: spbot109Disallow: /110111User-agent: SurveyBot112Disallow: /113114User-agent: TurnitinBot115Disallow: /116117User-agent: Vagabondo118Disallow: /119120User-agent: VelenPublicWebCrawler121Disallow: /122123User-agent: WebDataStats124Disallow: /125126User-agent: WebEnhancer127Disallow: /128129User-agent: WebStripper130Disallow: /131132User-agent: WebSauger133Disallow: /134135User-agent: WebZIP136Disallow: /137138User-agent: WotBox139Disallow: /140141User-agent: Wprecon142Disallow: /143144User-agent: Xaldon_WebSpider145Disallow: /146147Sitemap: https://yoursite.com/sitemap-llm.xml`;148149 setHeader(event, 'Content-Type', 'text/plain');150 setHeader(event, 'Cache-Control', 'public, max-age=86400, stale-while-revalidate=604800');151152 return robots;153});
Create an LLM-optimized sitemap that includes all GEO endpoints
1export default defineEventHandler(async (event) => {2 const sitemap = `<?xml version="1.0" encoding="UTF-8"?>3<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">4 <!-- Main site pages -->5 <url>6 <loc>https://yoursite.com/</loc>7 <lastmod>${new Date().toISOString().split('T')[0]}</lastmod>8 <changefreq>weekly</changefreq>9 <priority>1.0</priority>10 </url>1112 <!-- GEO Contract Endpoints -->13 <url>14 <loc>https://yoursite.com/.well-known/ai.txt</loc>15 <lastmod>${new Date().toISOString().split('T')[0]}</lastmod>16 <changefreq>monthly</changefreq>17 <priority>0.8</priority>18 </url>19 <url>20 <loc>https://yoursite.com/ai/summary.json</loc>21 <lastmod>${new Date().toISOString().split('T')[0]}</lastmod>22 <changefreq>weekly</changefreq>23 <priority>0.8</priority>24 </url>25 <url>26 <loc>https://yoursite.com/ai/faq.json</loc>27 <lastmod>${new Date().toISOString().split('T')[0]}</lastmod>28 <changefreq>monthly</changefreq>29 <priority>0.7</priority>30 </url>31 <url>32 <loc>https://yoursite.com/ai/service.json</loc>33 <lastmod>${new Date().toISOString().split('T')[0]}</lastmod>34 <changefreq>monthly</changefreq>35 <priority>0.7</priority>36 </url>3738 <!-- Other site pages -->39 <url>40 <loc>https://yoursite.com/docs</loc>41 <lastmod>${new Date().toISOString().split('T')[0]}</lastmod>42 <changefreq>weekly</changefreq>43 <priority>0.9</priority>44 </url>45</urlset>`;4647 setHeader(event, 'Content-Type', 'application/xml');48 setHeader(event, 'Cache-Control', 'public, max-age=86400, stale-while-revalidate=604800');4950 return sitemap;51});
Complete your Vue.js GEO implementation