+ `},redir=(a,b)=>{window.location.href="https://quartz.jzhao.xyz/"+`${a}#:~:text=${encodeURIComponent(b)}`},fetch=a=>({id:a,url:a,title:scrapedContent[a].title,content:scrapedContent[a].content}),source=document.getElementById('search-bar'),results=document.getElementById("results-container");let term;source.addEventListener("keyup",a=>{if(a.key==="Enter"){const a=document.getElementsByClassName("result-card")[0];redir(a.id,term)}}),source.addEventListener('input',a=>{term=a.target.value,contentIndex.search(term,[{field:"content",limit:10,suggest:!0},{field:"title",limit:5}]).then(a=>{const c=[...a.filter(a=>a.field==='title')?.[0].result]??[],d=[...a.filter(a=>a.field==='content')?.[0].result]??[],e=[...c,...d],b=e.map(fetch);if(b.length===0)results.innerHTML=`
`;else{results.innerHTML=b.map(a=>resultToHTML({...a,term})).join("\n");const a=document.getElementsByClassName("result-card");[...a].forEach(a=>{a.onclick=()=>redir(a.id,term)})}})});const searchContainer=document.getElementById("search-container");function openSearch(){searchContainer.style.display==="none"||searchContainer.style.display===""?(source.value="",results.innerHTML="",searchContainer.style.display="block",source.focus()):searchContainer.style.display="none"}function closeSearch(){searchContainer.style.display="none"}document.addEventListener('keydown',a=>{a.key==="/"&&(a.preventDefault(),openSearch()),a.key==="Escape"&&(a.preventDefault(),closeSearch())}),window.addEventListener('DOMContentLoaded',()=>{const a=document.getElementById("search-icon");a.addEventListener('click',a=>{openSearch()}),a.addEventListener('keydown',a=>{openSearch()}),searchContainer.addEventListener('click',a=>{closeSearch()}),document.getElementById("search-space").addEventListener('click',a=>{a.stopPropagation()})})
šŖ“ Quartz v2.1
Host your second brain and
digital garden
for free. Quartz features
- Extremely fast full-text search by pressing
/ - Beautiful, out-of-the-box website creation and deployment
- Display for backlinks of each note
- A customizable graph view
- Endlessly powerful page and theme customization
Get Started
š
@@ -13,4 +13,4 @@ built with Quartz, or read about
why I made Quartz
to begin with!
Troubleshooting
\ No newline at end of file
+
Submit an Issue