PageSourceSearch

https://www.onursendere.com/_astro/BaseLayout.astro_astro_type_script_index_0_lang.M_AIfANQ.js

js onursendere.com collected 2026-10-01 23:51:39 UTC 3,656 bytes, 1 lines download raw bytes

1const p=document.getElementById("live"),h=e=>{p&&(p.textContent="",requestAnimationFrame(()=>p.textContent=e))};document.querySelectorAll("[data-theme-toggle]").forEach(e=>{e.addEventListener("click",()=>{const a=document.documentElement,n=(a.dataset.theme||(matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"))==="dark"?"light":"dark";a.dataset.theme=n;try{localStorage.setItem("theme",n)}catch{}h(n==="dark"?"Koyu tema açıldı":"Açık tema açıldı")})});const s=document.querySelector("[data-sheet-open]");let d=null;const f=document.querySelector("svg use")?.getAttribute("href")?.split("#")[0]||"/icons.svg",y=e=>`<svg aria-hidden="true"><use href="${f}#${e}"/></svg>`;function b(){const e=document.createElement("dialog");e.id="menu",e.className="sheet",e.setAttribute("aria-label","Menü");const a=document.createElement("div");a.className="sheet-header";const r=document.querySelector(".site-header .logo");r&&a.append(r.cloneNode(!0));const n=document.createElement("button");n.type="button",n.className="btn btn-ghost btn-icon",n.setAttribute("aria-label","Menüyü kapat"),n.innerHTML=y("x"),n.addEventListener("click",()=>e.close()),a.append(n);const o=document.createElement("nav");o.className="sheet-body",o.setAttribute("aria-label","Mobil menü");const u=t=>{const m=t.cloneNode(!0);m.removeAttribute("class"),m.className="sheet-link",o.append(m)};document.querySelectorAll(".site-header .nav a").forEach(u);const c=document.createElement("span");c.className="sheet-label",c.textContent="Blog",o.append(c);const l=new Set([...o.querySelectorAll("a")].map(t=>t.getAttribute("href")));document.querySelectorAll("#f-blog + ul a").forEach(t=>{l.has(t.getAttribute("href"))||u(t)});const i=document.createElement("div");return i.className="sheet-foot",document.querySelectorAll('.ftr-social a[rel="me"], .ftr-social a[href$="/feed"]').forEach(t=>i.append(t.cloneNode(!0))),e.append(a,o,i),e.addEventListener("click",t=>{t.target===e&&e.close()}),e.addEventListener("close",()=>{s?.setAttribute("aria-expanded","false"),s?.focus()}),document.body.append(e),e}s&&(s.addEventListener("click",()=>{d||(d=b(),s.setAttribute("aria-controls","menu")),d.showModal(),s.setAttribute("aria-expanded","true")}),addEventListener("pageshow",e=>{e.persisted&&d?.open&&d.close()}));addEventListener("keydown",e=>{if(!e.target.closest('input, textarea, select, [contenteditable="true"]')&&(e.key==="/"||(e.metaKey||e.ctrlKey)&&e.key.toLowerCase()==="k")){const r=document.querySelector('#search input, input[name="q"]');e.preventDefault(),r&&location.pathname==="/ara"?r.focus():location.href="/ara"}});{const e=document.modelContext||navigator.modelContext;if(e&&typeof e.registerTool=="function")try{e.registerTool({name:"find_posts",description:"Onur Şendere blogunda anahtar kelime veya konuyla arama yapar; eşleşen yazıların başlığını, bağlantısını ve kısa özetini döndürür. Sayfa açmaz, salt-okunurdur.",inputSchema:{type:"object",properties:{query:{type:"string",description:"Aranacak kelime veya konu (Türkçe)."},limit:{type:"integer",minimum:1,maximum:20,description:"En fazla sonuç sayısı (varsayılan 8)."}},required:["query"]},annotations:{readOnlyHint:!0,untrustedContentHint:!0},execute:async({query:a,limit:r})=>{try{const n=Math.max(1,Math.min(20,Number(r)||8)),c=await(await import("/pagefind/pagefind.js")).search(String(a||"")),l=[];for(const i of c.results.slice(0,n)){const t=await i.data();l.push({title:t.meta&&t.meta.title||"",url:t.url,excerpt:t.excerpt})}return JSON.stringify({query:a,count:l.length,results:l})}catch{return JSON.stringify({query:a,error:"search_unavailable"})}}})}catch{}}

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.