PageSourceSearch

https://babytoolshub.com/assets/IndexNowPage-Bc1wa5t0.js

js babytoolshub.com collected 2026-10-07 20:49:14 UTC 11,484 bytes, 1 lines download raw bytes

1import{c as I,r as a,j as e,L as A}from"./index-RRaMGgZy.js";import{H as B}from"./Helmet-BBFS445H.js";import{L as g}from"./loader-circle-DyvBcyt2.js";import{C as i}from"./circle-alert-NaVI9Kfa.js";import{C as j}from"./circle-check-DDuFMncQ.js";import{F}from"./file-text-BiUMbxbv.js";import{E as L}from"./external-link-DprS-DBF.js";import{L as $}from"./list-checks-ktyHSgqq.js";import{S as K}from"./search-CbI1HM6V.js";const O=I("KeyRound",[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]);const T=I("Send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]),V="/hcgi/api",y={fetch:async(t,d={})=>await window.fetch(V+t,d)};function G(){const[t,d]=a.use
1State(null),[n,u]=a.useState(""),[h,U]=a.useState(null),[N,C]=a.useState(!1),[p,k]=a.useState(!1),[r,v]=a.useState(null),[S,f]=a.useState(""),b=a.useCallback(async()=>{u("");try{const s=await y.fetch("/indexnow/status");if(!s.ok)throw new Error(`status ${s.status}`);d(await s.json())}catch(s){u(s.message||"Could not reach the IndexNow status endpoint.")}},[]);a.useEffect(()=>{b()},[b]);const E=a.useCallback(async()=>{try{const s=await y.fetch("/indexnow/urls");if(!s.ok)throw new Error(`status ${s.status}`);U(await s.json()),C(!0)}catch(s){u(s.message||"Could not load the URL list.")}},[]),P=a.useCallback(async()=>{k(!0),f(""),v(null);try{const s=await y.fetch("/indexnow/submit",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({})}),o=await s.json().catch(()=>({}));if(s.ok||s.status===207||s.status===502&&o&&o.endpoints)v(o),!s.ok&&s.status!==207&&!(o.endpoints||[]).some(x=>x.ok)&&f(o.hint||"No IndexNow partner accepted the submission — see details below.");else throw new Error(o.message||o.error||`submit failed: ${s.status}`)}catch(s){f(s.message||"Submission failed.")}finally{k(!1)}},[]),l=t?.configured,c=t?.keyLocation,m=t?.keyFileVerified,R=t?.keyFileReason,H=!t&&!n;return e.jsxs(e.Fragment,{children:[e.jsxs(B,{children:[e.jsx("title",{children:"IndexNow — BabyToolsHub"}),e.jsx("meta",{name:"description",content:"IndexNow setup and URL submission tool for BabyToolsHub."}),e.jsx("meta",{name:"robots",content:"noindex"})]}),e.jsxs("div",{className:"mx-auto max-w-3xl px-4 py-12 sm:px-6",children:[e.jsx("h1",{className:"font-display text-3xl font-bold",children:"IndexNow setup"}),e.jsx("p",{className:"mt-2 text-muted-foreground",children:"Notify search engines (Bing, Yandex, Naver, Seznam, Yep) when BabyToolsHub pages are created or updated, so they re-crawl faster instead of waiting to rediscover them."}),e.jsxs(w,{title:"1 · API key & key file",icon:O,children:[e.jsxs("p",{className:"text-sm text-muted-foreground",children:["An IndexNow API key was generated and stored server-side in"," ",e.jsx("code",{className:"rounded bg-muted px-1.5 py-0.5 text-xs",children:"apps/api/.env"})," as"," ",e.jsx("code",{className:"rounded bg-muted px-1.5 py-0.5 text-xs",children:"INDEXNOW_KEY"}),". It is never shipped to the browser. The same key is published as a UTF-8 text file at the site root so search engines can verify domain ownership."]}),e.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-2 text-sm",children:[H?e.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-full bg-sky-50 px-3 py-1 font-semibold text-primary",children:[e.jsx(g,{className:"h-4 w-4 animate-spin"})," Checking configuration…"]}):n?e.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-full bg-rose-50 px-3 py-1 font-semibold text-rose-700",children:[e.jsx(i,{className:"h-4 w-4"})," Status check failed"]}):l?m?e.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-full bg-emerald-50 px-3 py-1 font-semibold text-emerald-700",children:[e.jsx(j,{className:"h-4 w-4"})," Key configured & verified"]}):e.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-full bg-amber-50 px-3 py-1 font-semibold text-amber-700",children:[e.jsx(i,{className:"h-4 w-4"})," Key configured, file not verified"]}):e.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-full bg-rose-50 px-3 py-1 font-semibold text-rose-700",children:[e.jsx(i,{className:"h-4 w-4"})," Key not configured"]}),c&&e.jsxs("a",{href:c,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5 rounded-full bg-sky-50 px-3 py-1 font-semibold text-primary hover:underline",children:[e.jsx(F,{className:"h-4 w-4"})," Open key file",e.jsx(L,{className:"h-3 w-3"})]}),l&&!m&&!n&&e.jsxs("button",{type:"button",onClick:b,className:"inline-flex items-center gap-1.5 rounded-full border border-border bg-card px-3 py-1 font-semibold text-foreground transition-colors hover:bg-muted",children:[e.jsx(g,{className:"h-3.5 w-3.5"})," Re-check"]})]}),l&&!m&&!n&&R&&e.jsxs("p",{className:"mt-3 rounded-lg bg-amber-50 p-3 text-xs text-amber-800",children:["The server-side key is set, but the public key file could not be verified at"," ",e.jsx("span",{className:"break-all font-mono",children:c}),". Reason: ",R,"."," ","If you just published the key file, wait a moment and click ",e.jsx("strong",{children:"Re-check"}),"."]}),l&&m&&!n&&e.jsxs("p",{className:"mt-3 rounded-lg bg-emerald-50 p-3 text-xs text-emerald-800",children:["The key file at ",e.jsx("span",{className:"break-all font-mono",children:c})," returned"," ",e.jsx("strong",{children:"HTTP 200"})," with the key as plain text, matching the server-side configuration. Search engines can verify domain ownership — you're ready to submit."]}),!l&&!n&&e.jsxs("p",{className:"mt-3 rounded-lg bg-amber-50 p-3 text-xs text-amber-800",children:["The key file must return ",e.jsx("strong",{children:"HTTP 200"})," with the key as plain text on the live domain. If you just added it, ",e.jsx("strong",{children:"publish the site"})," first, then open the key-file link above to confirm it loads before submitting."]})]}),e.jsxs(w,{title:"2 · Submit URLs",icon:T,children:[e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Submits the site's current canonical URLs (read from"," ",e.jsx("code",{className:"rounded bg-muted px-1.5 py-0.5 text-xs",children:"sitemap.xml"}),") to the IndexNow API. Only live, HTTPS, non-www, trailing-slash canonical URLs are sent — retired/redirected URLs and www/HTTP variants are never submitted."]}),e.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-3",children:[e.jsxs("button",{type:"button",onClick:P,disabled:!l||p,className:"inline-flex items-center gap-2 rounded-full bg-primary px-5 py-2.5 text-sm font-bold text-primary-foreground transition-colors hover:bg-primary/90 disabled:cursor-not-allowed disabled:opacity-50",children:[p?e.jsx(g,{className:"h-4 w-4 animate-spin"}):e.jsx(T,{className:"h-4 w-4"}),p?"Submitting…":"Submit all canonical URLs"]}),e.jsxs("button",{type:"button",onClick:E,className:"inline-flex items-center gap-2 rounded-full border border-border bg-card px-4 py-2.5 text-sm font-semibold text-foreground transition-colors hover:bg-muted",children:[e.jsx($,{className:"h-4 w-4"})," ",N?"Refresh":"Preview"," URL list"]}),t&&e.jsxs("span",{className:"text-sm font-semibold text-muted-foreground",children:[t.urlCount," URLs ready"]})]}),S&&e.jsxs("div",{className:"mt-4 flex items-start gap-2 rounded-lg bg-rose-50 p-3 text-sm text-rose-700",children:[e.jsx(i,{className:"mt-0.5 h-4 w-4 shrink-0"}),e.jsx("span",{children:S})]}),r&&e.jsxs("div",{className:"mt-4 rounded-lg border border-border bg-muted/40 p-4 text-sm",children:[e.jsxs("div",{className:"flex items-center gap-2 font-semibold",children:[r.ok?e.jsx(j,{className:"h-4 w-4 text-emerald-600"}):e.jsx(i,{className:"h-4 w-4 text-amber-600"}),r.ok?`Submitted ${r.submitted}
1 URLs to all IndexNow partners.`:`Submitted ${r.submitted} URLs — some partners did not accept (see below).`]}),e.jsxs("div",{className:"mt-2 text-xs text-muted-foreground",children:[r.totalUrls," canonical URLs sent to ",r.endpoints?.length||0," IndexNow partner endpoints."]}),e.jsx("ul",{className:"mt-3 space-y-2 text-xs",children:r.endpoints?.map(s=>{const o=s.chunks?.map(x=>`HTTP ${x.status} ${x.statusText}`).join(", ");return e.jsxs("li",{className:"rounded-md bg-card p-2",children:[e.jsxs("div",{className:"flex items-center gap-2 font-semibold",children:[s.ok?e.jsx(j,{className:"h-3.5 w-3.5 text-emerald-600"}):e.jsx(i,{className:"h-3.5 w-3.5 text-rose-600"}),s.name,e.jsx("span",{className:`font-normal ${s.ok?"text-emerald-700":"text-rose-700"}`,children:s.ok?"accepted":"rejected"})]}),e.jsx("div",{className:"mt-1 break-all font-mono text-[11px] text-muted-foreground",children:s.url}),e.jsx("div",{className:"mt-0.5 text-[11px] text-muted-foreground",children:o})]},s.name)})}),r.hint&&e.jsx("p",{className:"mt-3 rounded bg-amber-50 p-2 text-xs text-amber-800",children:r.hint})]}),N&&h&&e.jsxs("details",{className:"mt-4 rounded-lg border border-border bg-card p-3",open:!0,children:[e.jsxs("summary",{className:"cursor-pointer text-sm font-semibold",children:[h.total," canonical URLs to be submitted"]}),e.jsx("ol",{className:"mt-2 max-h-72 list-decimal space-y-0.5 overflow-auto pl-5 text-xs text-muted-foreground",children:h.urls.map(s=>e.jsx("li",{className:"break-all font-mono",children:s},s))})]})]}),e.jsx(w,{title:"3 · Verify in Bing Webmaster Tools",icon:K,children:e.jsxs("ol",{className:"mt-1 list-decimal space-y-2 pl-5 text-sm text-muted-foreground",children:[e.jsxs("li",{children:["Open"," ",e.jsxs("a",{href:"https://www.bing.com/webmasters",target:"_blank",rel:"noopener noreferrer",className:"font-semibold text-primary hover:underline",children:["Bing Webmaster Tools ",e.jsx(L,{className:"inline h-3 w-3"})]})," ","and sign in with the account that owns ",e.jsx("strong",{children:"babytoolshub.com"}),"."]}),e.jsx("li",{children:'If the site is not yet added, add it and verify ownership (the key file above can also serve as the "IndexNow key" verification option).'}),e.jsxs("li",{children:["After submitting from this page, go to"," ",e.jsx("strong",{children:"URL Submission → IndexNow"})," (or"," ",e.jsx("strong",{children:"Sitemaps / URL Submission"}),") to confirm Bing received the URLs. A 200/202 response here means the submission was accepted; indexing itself still depends on Bing's crawl priorities."]}),e.jsx("li",{children:"Re-submit from this page whenever you publish new or materially updated content. IndexNow is a re-crawl hint, not a guarantee of indexing."})]})}),n&&e.jsxs("div",{className:"mt-4 flex items-start gap-2 rounded-lg bg-rose-50 p-3 text-sm text-rose-700",children:[e.jsx(i,{className:"mt-0.5 h-4 w-4 shrink-0"}),e.jsx("span",{children:n})]}),e.jsx("p",{className:"mt-8 text-center text-xs text-muted-foreground",children:e.jsx(A,{to:"/",className:"font-semibold text-primary hover:underline",children:"Back to BabyToolsHub home"})})]})]})}const w=({title:t,icon:d,children:n})=>e.jsxs("section",{className:"mt-6 rounded-3xl border border-border bg-card p-6 soft-shadow",children:[e.jsxs("h2",{className:"flex items-center gap-2 font-display text-xl font-bold",children:[e.jsx(d,{className:"h-5 w-5 text-primary"})," ",t]}),e.jsx("div",{className:"mt-3",children:n})]});export{G 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.