1import{e as U,r as i,j as e,W as D,m as X,a4 as M,aY as B,C as o,k as c,ac as Y,I as z,B as h,n as E,ai as W,l as Z,U as $}from"./index-rcEjR4Qj.js";import{T as K}from"./textarea-D4cb0GJg.js";import{t as V}from"./trackActivity-CmthynzF.js";import{M as q}from"./mail-BB3xFVne.js";import{C as Q}from"./copy-D5_VRmSR.js";import{D as H}from"./download-CNQHQXSP.js";function ne(){const{toast:m}=U(),[p,J]=i.useState(""),[j,f]=i.useState(!1),[t,g]=i.useState(null),[d,N]=i.useState(""),[F,y]=i.useState(!1),[x,L]=i.useState(""),[b,w]=i.useState(!1),[P,v]=i.useState(!1);i.useEffect(()=>{t!=null&&t.ok&&N(t.llms_txt),v(!1)},[t==null?void 0:t.origin,t==null?void 0:t.ok]);const k="Free llms.txt Generator â Tell AI assistants about your site | Outranker",I="Paste any URL and instantly generate a spec-compliant /llms.txt file for ChatGPT, Claude, Perplexity and other AI search engines. Free, no signup.",C="https://www.outranker.com/free-tools/llms-txt-generator",T=async()=>{if(!p.trim()){m({title:"Enter a URL",description:"Paste any domain to generate llms.txt.",variant:"destructive"});return}f(!0),g(null);try{const s="https://cemoyczgfrsspjdgczys.supabase.co",a="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImNlbW95Y3pnZnJzc3BqZGdjenlzIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NDYxNjIxNzIsImV4cCI6MjA2MTczODE3Mn0.ndoSIGo7DI_CTvnehrJtQRjPPX2lWA8vXKXLsX-i1tw",l=await fetch(`${s}/functions/v1/free-tools-llms-generator`,{method:"POST",headers:{"Content-Type":"application/json",apikey:a,Authorization:`Bearer ${a}`},body:JSON.stringify({url:p})}),n=await l.json().catch(()=>null);if(!l.ok)throw new Error(n&&n.error||`Request failed (${l.status})`);g(n);try{V({source_tool:"llms-txt-generator",target_url:p,email_gate_shown:!0})}catch{}n&&n.ok===!1&&m({title:"Could not generate",description:n.error??"Unknown error",variant:"destructive"})}catch(s){m({title:"Generation failed",description:String((s==null?void 0:s.message)??s),variant:"destructive"})}finally{f(!1)}},G=async()=>{if(d)try{await navigator.clipboard.writeText(d),y(!0),setTimeout(()=>y(!1),1800)}catch{m({title:"Copy failed",variant:"destructive"})}},A=()=>{if(!d)return;const s=new Blob([d],{type:"text/plain;charset=utf-8"}),a=document.createElement("a");a.href=URL.createObjectURL(s),a.download="llms.txt",document.body.appendChild(a),a.click(),a.remove(),URL.revokeObjectURL(a.href)},O=async()=>{var s,a;if(!(!x.trim()||!(t!=null&&t.ok))){w(!0);try{const l="https://cemoyczgfrsspjdgczys.supabase.co",n="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImNlbW95Y3pnZnJzc3BqZGdjenlzIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NDYxNjIxNzIsImV4cCI6MjA2MTczODE3Mn0.ndoSIGo7DI_CTvnehrJtQRjPPX2lWA8vXKXLsX-i1tw",R={origin:t.origin,site:t.site,sitemap_found:t.sitemap_found,sitemap_url_count:t.sitemap_url_count,page_count:t.pages.length,pages:t.pages.slice(0,60),llms_txt:d.slice(0,6e4),bytes:new TextEncoder().encode(d).length},u=await fetch(`${l}/functions/v1/free-tools-lead-capture`,{method:"POST",headers:{"Content-Type":"application/json",apikey:n,Authorization:`Bearer ${n}`},body:JSON.stringify({email:x,source_tool:"llms-txt-generator",target_url:t.origin,referrer:document.referrer||null,marketing_opt_in:!0,brand_context:"platform",report:R})}),r=await u.json().catch(()=>null);if(!u.ok)throw new Error(r&&r.error||`Failed (${u.status})`);if(r!=null&&r.ok){v(!0);const S=(s=r==null?void 0:r.report_email)==null?void 0:s.sent,_=(a=r==null?void 0:r.report_email)==null?void 0:a.error;m({title:S?"llms.txt sent!":"You're on the list",description:S?`We just emailed your llms.txt file and PDF guide to ${x}.`:_?`Saved your email, but the report could not be sent: ${_}`:"Saved your email. The report will be sent shortly."})}}catch(l){m({title:"Could not save",description:(l==null?void 0:l.message)??"Try again",variant:"destructive"})}finally{w(!1)}}};return e.jsxs(e.Fragment,{children:[e.jsxs(D,{children:[e.jsx("title",{children:k}),e.jsx("meta",{name:"description",content:I}),e.jsx("link",{rel:"canonical",href:C}),e.jsx("meta",{property:"og:title",content:k}),e.jsx("meta",{property:"og:description",content:I}),e.jsx("meta",{property:"og:type",content:"website"}),e.jsx("meta",{property:"og:url",content:C})]}),e.jsxs("div",{className:"container mx-auto px-4 md:px-6 py-10 md:py-14 max-w-6xl",children:[e.jsx("div",{className:"mb-3",children:e.jsx(X,{to:"/free-tools",className:"text-sm text-muted-foreground hover:text-primary",children:"â Back to Free Tools"})}),e.jsxs("div",{className:"text-center max-w-3xl mx-auto mb-10",children:[e.jsxs(M,{variant:"secondary",className:"mb-3",children:[e.jsx(B,{className:"h-3 w-3 mr-1"})," Free tool · no signup"]}),e.jsxs("h1",{className:"text-3xl md:text-5xl font-bold tracking-tight mb-3",children:[e.jsx("span",{className:"text-primary",children:"llms.txt"})," Generator"]}),e.jsxs("p",{className:"text-muted-foreground text-lg",children:["Generate a spec-compliant ",e.jsx("code",{className:"font-mono text-sm bg-muted px-1.5 py-0.5 rounded",children:"/llms.txt"})," file so ChatGPT, Claude, Perplexity and other AI assistants can read your site directly â instead of guessing from JS-rendered HTML."]})]}),e.jsx(o,{className:"mb-8 border-primary/20",children:e.jsxs(c,{className:"pt-6",children:[e.jsxs("div",{className:"flex flex-col md:flex-row gap-3",children:[e.jsx("div",{className:"flex-1",children:e.jsxs("div",{className:"relative",children:[e.jsx(Y,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),e.jsx(z,{type:"url",placeholder:"Enter your site URL (e.g. example.com)",value:p,onChange:s=>J(s.target.value),onKeyDown:s=>s.key==="Enter"&&T(),className:"pl-10 h-12 text-base"})]})}),e.jsx(h,{onClick:T,disabled:j,size:"lg",className:"h-12 px-6",children:j?e.jsxs(e.Fragment,{children:[e.jsx(E,{className:"h-4 w-4 mr-2 animate-spin"})," Generating..."]}):e.jsxs(e.Fragment,{children:[e.jsx(W,{className:"h-4 w-4 mr-2"})," Generate llms.txt"]})})]}),e.jsxs("p",{className:"text-xs text-muted-foreground mt-3",children:["We crawl your homepage and sitemap, extract titles + descriptions, and build a clean ",e.jsx("span",{className:"font-mono",children:"llms.txt"})," ready to drop at your site root."]})]})}),t&&!t.ok&&e.jsx(o,{className:"mb-8 border-destructive/40",children:e.jsxs(c,{className:"pt-6 flex items-start gap-3",children:[e.jsx(Z,{className:"h-5 w-5 text-destructive shrink-0 mt-0.5"}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:"Generation failed"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:t.error})]})]})}),(t==null?void 0:t.ok)&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 mb-6",children:[e.jsx(o,{children:e.jsxs(c,{className:"pt-6",children:[e.jsx("p",{className:"text-xs text-muted-foreground uppercase tracking-wide",children:"Pages included"}),e.jsx("p",{className:"text-3xl font-bold",children:t.pages.length})]})}),e.jsx(o,{children:e.jsxs(c,{className:"pt-6",children:[e.jsx("p",{className:"text-xs text-muted-foreground uppercase tracking-wide",children:"Sitemap URLs foun
1d"}),e.jsx("p",{className:"text-3xl font-bold",children:t.sitemap_url_count}),e.jsx("p",{className:"text-xs text-muted-foreground",children:t.sitemap_found?"via sitemap.xml":"no sitemap"})]})}),e.jsx(o,{children:e.jsxs(c,{className:"pt-6",children:[e.jsx("p",{className:"text-xs text-muted-foreground uppercase tracking-wide",children:"File size"}),e.jsxs("p",{className:"text-3xl font-bold",children:[(new TextEncoder().encode(d).length/1024).toFixed(1),e.jsx("span",{className:"text-base text-muted-foreground",children:" KB"})]})]})}),e.jsx(o,{children:e.jsxs(c,{className:"pt-6",children:[e.jsx("p",{className:"text-xs text-muted-foreground uppercase tracking-wide",children:"Homepage"}),e.jsx("p",{className:"text-3xl font-bold",children:t.homepage_status||"â"}),e.jsx("p",{className:"text-xs text-muted-foreground truncate",children:t.site.name||"â"})]})})]}),e.jsx(o,{className:"mb-6 bg-primary/5 border-primary/30",children:e.jsx(c,{className:"pt-6",children:e.jsxs("div",{className:"flex flex-col md:flex-row md:items-center gap-3",children:[e.jsx(q,{className:"h-5 w-5 text-primary shrink-0"}),e.jsxs("div",{className:"flex-1",children:[e.jsx("p",{className:"font-medium",children:"Email me the llms.txt file + setup PDF"}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:["We'll send the ",e.jsx("span",{className:"font-mono",children:"llms.txt"})," as an attachment plus a branded PDF with setup instructions."]}),P&&e.jsx("p",{className:"text-sm text-emerald-600 mt-1",children:"Sent â check your inbox."})]}),e.jsxs("div",{className:"flex gap-2 w-full md:w-auto",children:[e.jsx(z,{type:"email",placeholder:"[email protected]",value:x,onChange:s=>L(s.target.value),className:"md:w-64"}),e.jsx(h,{onClick:O,disabled:b||!x.trim(),children:b?e.jsx(E,{className:"h-4 w-4 animate-spin"}):"Email me"})]})]})})}),e.jsx(o,{className:"mb-6",children:e.jsxs(c,{className:"pt-6",children:[e.jsxs("div",{className:"flex items-center justify-between mb-3 gap-3 flex-wrap",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-bold",children:"Your llms.txt"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Edit freely below, then copy or download."})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(h,{variant:"outline",size:"sm",onClick:G,children:F?e.jsxs(e.Fragment,{children:[e.jsx($,{className:"h-4 w-4 mr-1.5"})," Copied"]}):e.jsxs(e.Fragment,{children:[e.jsx(Q,{className:"h-4 w-4 mr-1.5"})," Copy"]})}),e.jsxs(h,{size:"sm",onClick:A,children:[e.jsx(H,{className:"h-4 w-4 mr-1.5"})," Download"]})]})]}),e.jsx(K,{value:d,onChange:s=>N(s.target.value),className:"font-mono text-xs min-h-[420px]",spellCheck:!1}),e.jsxs("div",{className:"mt-3 text-xs text-muted-foreground space-y-1",children:[e.jsxs("p",{children:[e.jsx("strong",{children:"Where to put it:"})," upload as ",e.jsx("span",{className:"font-mono",children:"/llms.txt"})," at your site root (same place as ",e.jsx("span",{className:"font-mono",children:"/robots.txt"}),")."]}),e.jsxs("p",{children:[e.jsx("strong",{children:"Then tell crawlers:"})," add ",e.jsxs("span",{className:"font-mono",children:["LLMsitemap: ",t.origin,"/llms.txt"]})," to your ",e.jsx("span",{className:"font-mono",children:"robots.txt"}),"."]})]})]})}),e.jsx(o,{className:"mb-6",children:e.jsxs(c,{className:"pt-6",children:[e.jsxs("p",{className:"text-sm font-bold mb-3",children:["Pages discovered (",t.pages.length,")"]}),e.jsx("div",{className:"space-y-2",children:t.pages.map(s=>e.jsxs("div",{className:"border rounded-md p-3 text-sm",children:[e.jsx("a",{href:s.url,target:"_blank",rel:"noopener noreferrer",className:"font-medium text-primary hover:underline break-all",children:s.title||s.url}),e.jsx("p",{className:"text-xs text-muted-foreground break-all",children:s.url}),s.description&&e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:s.description})]},s.url))})]})})]}),e.jsxs("section",{className:"mt-16 prose prose-sm max-w-3xl mx-auto dark:prose-invert",children:[e.jsx("h2",{children:"What is llms.txt?"}),e.jsxs("p",{children:[e.jsx("code",{children:"/llms.txt"})," is a markdown file at the root of your site that tells AI assistants like ChatGPT, Claude, and Perplexity what your site is about and which pages matter. It's the AI-era equivalent of ",e.jsx("code",{children:"robots.txt"})," + ",e.jsx("code",{children:"sitemap.xml"})," â but written in plain markdown so language models can parse it without rendering JavaScript."]}),e.jsx("h3",{children:"Why it matters"}),e.jsxs("ul",{children:[e.jsx("li",{children:"AI crawlers skip the JS shell and read your content directly."}),e.jsx("li",{children:"You control which pages are surfaced to AI answers."}),e.jsx("li",{children:"Cleaner context = better citations and summaries."})]})]})]})]})}export{ne as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.