Skip to content

Commit

Permalink
deploy: f5c915c
Browse files Browse the repository at this point in the history
  • Loading branch information
gabek committed Oct 7, 2024
1 parent a26ec90 commit f9f5048
Show file tree
Hide file tree
Showing 8 changed files with 3,958 additions and 2,387 deletions.
2 changes: 1 addition & 1 deletion 404/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<title>Nothing here</title>
<link href="/styles/digital-garden-base.css" rel="stylesheet">
<link href="/styles/obsidian-base.css" rel="stylesheet">
<link href="/styles/_theme.76a44f9a.css" rel="stylesheet">
<link href="/styles/_theme.e60b8f4b.css" rel="stylesheet">
<link href="/styles/custom-style.css" rel="stylesheet">
</head>
<body class="theme-dark markdown-preview-view">
Expand Down
1 change: 0 additions & 1 deletion CNAME

This file was deleted.

4 changes: 2 additions & 2 deletions feed.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
<title>Gabe&#39;s Digital Life</title>
<link href="https://garden.gabekangas.com/feed.xml" rel="self" >
<link href="https://garden.gabekangas.com" >
<updated>2024-10-07T23:36:37Z</updated>
<updated>2024-10-07T23:39:21Z</updated>
<id>https://garden.gabekangas.com</id>
<entry>
<title>
Owncast&#39;s 4th Anniversary

</title>
<updated>2024-10-07T23:36:29Z</updated>
<updated>2024-10-07T23:39:14Z</updated>
<id>https://garden.gabekangas.com/</id>
<content type="html">
&lt;p&gt;May 23rd, 2024 marks the 4th anniversary of the first commit of Owncast, aptly titled: “WIP”.&lt;/p&gt;
Expand Down
4 changes: 2 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<script src="https://fastly.jsdelivr.net/npm/whatwg-fetch@3.6.2/dist/fetch.umd.min.js" crossorigin="anonymous" referrerpolicy="no-referrer" async></script>
<link href="/styles/digital-garden-base.css" rel="stylesheet">
<link href="/styles/obsidian-base.css" rel="stylesheet">
<link href="/styles/_theme.76a44f9a.css" rel="stylesheet">
<link href="/styles/_theme.e60b8f4b.css" rel="stylesheet">
<link href="/styles/custom-style.css" rel="stylesheet">
<link rel="icon" href="/favicon.ico" sizes="any">
<link rel="icon" href="/favicon.svg" type="image/svg+xml">
Expand Down Expand Up @@ -63,7 +63,7 @@ <h1 style="margin:15px!important">Gabe&#39;s Digital Life</h1>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/flexsearch@0.7.21/dist/flexsearch.bundle.js"></script>
<script>document.addEventListener("DOMContentLoaded",init,!1),document.addEventListener("DOMContentLoaded",setCorrectShortcut,!1),window.toggleSearch=function(){document.getElementById("globalsearch").classList.contains("active")?document.getElementById("globalsearch").classList.remove("active"):(document.getElementById("globalsearch").classList.add("active"),document.getElementById("term").focus())},window.toggleTagSearch=function(e){console.log(e.textContent);const t=e.textContent;t&&(window.document.getElementById("term").value=t.trim(),window.toggleSearch(),window.search())};const loadingSvg='\n <svg width="100" height="100" viewBox="0 0 45 45" xmlns="http://www.w3.org/2000/svg" stroke="#fff">\n <g fill="none" fill-rule="evenodd" transform="translate(1 1)" stroke-width="2">\n <circle cx="22" cy="22" r="6" stroke-opacity="0">\n <animate attributeName="r"\n begin="1.5s" dur="3s"\n values="6;22"\n calcMode="linear"\n repeatCount="indefinite" />\n <animate attributeName="stroke-opacity"\n begin="1.5s" dur="3s"\n values="1;0" calcMode="linear"\n repeatCount="indefinite" />\n <animate attributeName="stroke-width"\n begin="1.5s" dur="3s"\n values="2;0" calcMode="linear"\n repeatCount="indefinite" />\n </circle>\n <circle cx="22" cy="22" r="6" stroke-opacity="0">\n <animate attributeName="r"\n begin="3s" dur="3s"\n values="6;22"\n calcMode="linear"\n repeatCount="indefinite" />\n <animate attributeName="stroke-opacity"\n begin="3s" dur="3s"\n values="1;0" calcMode="linear"\n repeatCount="indefinite" />\n <animate attributeName="stroke-width"\n begin="3s" dur="3s"\n values="2;0" calcMode="linear"\n repeatCount="indefinite" />\n </circle>\n <circle cx="22" cy="22" r="8">\n <animate attributeName="r"\n begin="0s" dur="1.5s"\n values="6;1;2;3;4;5;6"\n calcMode="linear"\n repeatCount="indefinite" />\n </circle>\n </g>\n </svg>';function debounce(e,t,n){var a;return function(){var r=this,i=arguments,c=n&&!a;clearTimeout(a),a=setTimeout((function(){a=null,n||e.apply(r,i)}),t),c&&e.apply(r,i)}}function setCorrectShortcut(){navigator.platform.toUpperCase().indexOf("MAC")>=0&&document.querySelectorAll(".search-keys").forEach((e=>e.innerHTML="⌘ + K"))}function createIndex(e){const t=e=>e.toLowerCase().split(/([^a-z]|[^\x00-\x7F])/),n=new FlexSearch.Document({cache:!0,charset:"latin:extra",optimize:!0,index:[{field:"content",tokenize:"reverse",encode:t},{field:"title",tokenize:"forward",encode:t},{field:"tags",tokenize:"forward",encode:t}]});return e.forEach(((e,t)=>{n.add({id:t,title:e.title,content:e.content,tags:e.tags})})),n}async function init(){let e=!0;if(localStorage.getItem("searchIndex")){let{date:t,docs:n}=JSON.parse(localStorage.getItem("searchIndex"));if("2024-10-07T23:36:37.030Z"===t){e=!1;let t=createIndex(n);window.docs=n,window.index=t}}if(e){let e=await(await fetch("/searchIndex.json?v=2024-10-07T23:36:37.030Z")).json(),t=createIndex(e);localStorage.setItem("searchIndex",JSON.stringify({date:"2024-10-07T23:36:37.030Z",docs:e})),window.docs=e,window.index=t}document.addEventListener("keydown",(e=>{if((e.ctrlKey||e.metaKey)&&"k"===e.key&&(e.preventDefault(),toggleSearch()),"Escape"===e.key&&document.getElementById("globalsearch").classList.remove("active"),document.getElementById("globalsearch").classList.contains("active")){if("ArrowDown"===e.key){e.preventDefault();let t=document.querySelector(".searchresult.active");t?(t.classList.remove("active"),t.nextElementSibling?t.nextElementSibling.classList.add("active"):document.querySelector(".searchresult").classList.add("active")):document.querySelector(".searchresult").classList.add("active");let n=document.querySelector(".searchresult.active");n&&n.scrollIntoView({behavior:"smooth",block:"nearest",inline:"start"})}if("ArrowUp"===e.key){e.preventDefault();let t=document.querySelector(".searchresult.active");t?(t.classList.remove("active"),t.previousElementSibling?t.previousElementSibling.classList.add("active"):document.querySelectorAll(".searchresult").forEach((e=>{e.nextElementSibling||e.classList.add("active")}))):document.querySelectorAll(".searchresult").forEach((e=>{e.nextElementSibling&&e.classList.add("active")}));let n=document.querySelector(".searchresult.active");n&&n.scrollIntoView({behavior:"smooth",block:"nearest",inline:"start"})}if("Enter"===e.key){e.preventDefault();let t=document.querySelector(".searchresult.active");t&&(window.location.href=t.querySelector("a").href)}}}));const t=debounce(search,200,!1);field=document.querySelector("#term"),field.addEventListener("keydown",(e=>{"ArrowDown"!==e.key&&"ArrowUp"!==e.key&&t()})),resultsDiv=document.querySelector("#search-results");const n=new URL(location.href).searchParams;n.get("q")&&(field.setAttribute("value",n.get("q")),toggleSearch(),search())}async function search(){let e=field.value.trim();if(!e)return;if(e==lastSearch)return;console.log(`search for ${e}`),window.lastSearch=e,resultsDiv.innerHTML=loadingSvg;let t=offlineSearch(e),n="";if(!t.length){let t=document.createElement("p");return t.innerText=`No results for "${e}"`,resultsDiv.innerHTML="",void resultsDiv.appendChild(t)}n+='<div style="max-width:100%;">',t.forEach((e=>{e.tags&&e.tags.length>0?n+=`<div class="searchresult">\n <a class="search-link" href="${e.url}">${e.title}</a>\n <div onclick="window.location='${e.url}'">\n <div class="header-meta">\n <div class="header-tags">\n ${e.tags.map((e=>'<a class="tag" href="JavaScript:Void(0);">#'+e+"</a>")).join("")}\n </div>\n </div>\n ${e.content}\n </div>\n </div>`:n+=`<div class="searchresult">\n <a class="search-link" href="${e.url}">${e.title}</a>\n <div onclick="window.location='${e.url}'">\n ${e.content}\n </div>\n </div>`})),n+="</div>",resultsDiv.innerHTML=n}function truncate(e,t){return(e=e.replaceAll(/<[^>]*>/g,"")).length<t?e:e.substring(0,t-3)+"..."}function offlineSearch(e){let t=window.docs,n="#"===e[0]&&e.length>1?index.search(e.substring(1),[{field:"tags"}]):index.search(e,[{field:"title",limit:5},{field:"content",weight:10}]);const a=e=>{const t=n.filter((t=>t.field===e));return 0===t.length?[]:[...t[0].result]};return[...new Set([...a("title"),...a("content"),...a("tags")])].map((e=>{let n=t[e];return n.content=truncate(n.content,400),n.tags=n.tags.filter((e=>"gardenEntry"!=e&&"note"!=e)),n}))}window.lastSearch=""</script>
<script>document.addEventListener("DOMContentLoaded",init,!1),document.addEventListener("DOMContentLoaded",setCorrectShortcut,!1),window.toggleSearch=function(){document.getElementById("globalsearch").classList.contains("active")?document.getElementById("globalsearch").classList.remove("active"):(document.getElementById("globalsearch").classList.add("active"),document.getElementById("term").focus())},window.toggleTagSearch=function(e){console.log(e.textContent);const t=e.textContent;t&&(window.document.getElementById("term").value=t.trim(),window.toggleSearch(),window.search())};const loadingSvg='\n <svg width="100" height="100" viewBox="0 0 45 45" xmlns="http://www.w3.org/2000/svg" stroke="#fff">\n <g fill="none" fill-rule="evenodd" transform="translate(1 1)" stroke-width="2">\n <circle cx="22" cy="22" r="6" stroke-opacity="0">\n <animate attributeName="r"\n begin="1.5s" dur="3s"\n values="6;22"\n calcMode="linear"\n repeatCount="indefinite" />\n <animate attributeName="stroke-opacity"\n begin="1.5s" dur="3s"\n values="1;0" calcMode="linear"\n repeatCount="indefinite" />\n <animate attributeName="stroke-width"\n begin="1.5s" dur="3s"\n values="2;0" calcMode="linear"\n repeatCount="indefinite" />\n </circle>\n <circle cx="22" cy="22" r="6" stroke-opacity="0">\n <animate attributeName="r"\n begin="3s" dur="3s"\n values="6;22"\n calcMode="linear"\n repeatCount="indefinite" />\n <animate attributeName="stroke-opacity"\n begin="3s" dur="3s"\n values="1;0" calcMode="linear"\n repeatCount="indefinite" />\n <animate attributeName="stroke-width"\n begin="3s" dur="3s"\n values="2;0" calcMode="linear"\n repeatCount="indefinite" />\n </circle>\n <circle cx="22" cy="22" r="8">\n <animate attributeName="r"\n begin="0s" dur="1.5s"\n values="6;1;2;3;4;5;6"\n calcMode="linear"\n repeatCount="indefinite" />\n </circle>\n </g>\n </svg>';function debounce(e,t,n){var a;return function(){var r=this,i=arguments,c=n&&!a;clearTimeout(a),a=setTimeout((function(){a=null,n||e.apply(r,i)}),t),c&&e.apply(r,i)}}function setCorrectShortcut(){navigator.platform.toUpperCase().indexOf("MAC")>=0&&document.querySelectorAll(".search-keys").forEach((e=>e.innerHTML="⌘ + K"))}function createIndex(e){const t=e=>e.toLowerCase().split(/([^a-z]|[^\x00-\x7F])/),n=new FlexSearch.Document({cache:!0,charset:"latin:extra",optimize:!0,index:[{field:"content",tokenize:"reverse",encode:t},{field:"title",tokenize:"forward",encode:t},{field:"tags",tokenize:"forward",encode:t}]});return e.forEach(((e,t)=>{n.add({id:t,title:e.title,content:e.content,tags:e.tags})})),n}async function init(){let e=!0;if(localStorage.getItem("searchIndex")){let{date:t,docs:n}=JSON.parse(localStorage.getItem("searchIndex"));if("2024-10-07T23:39:21.915Z"===t){e=!1;let t=createIndex(n);window.docs=n,window.index=t}}if(e){let e=await(await fetch("/searchIndex.json?v=2024-10-07T23:39:21.915Z")).json(),t=createIndex(e);localStorage.setItem("searchIndex",JSON.stringify({date:"2024-10-07T23:39:21.915Z",docs:e})),window.docs=e,window.index=t}document.addEventListener("keydown",(e=>{if((e.ctrlKey||e.metaKey)&&"k"===e.key&&(e.preventDefault(),toggleSearch()),"Escape"===e.key&&document.getElementById("globalsearch").classList.remove("active"),document.getElementById("globalsearch").classList.contains("active")){if("ArrowDown"===e.key){e.preventDefault();let t=document.querySelector(".searchresult.active");t?(t.classList.remove("active"),t.nextElementSibling?t.nextElementSibling.classList.add("active"):document.querySelector(".searchresult").classList.add("active")):document.querySelector(".searchresult").classList.add("active");let n=document.querySelector(".searchresult.active");n&&n.scrollIntoView({behavior:"smooth",block:"nearest",inline:"start"})}if("ArrowUp"===e.key){e.preventDefault();let t=document.querySelector(".searchresult.active");t?(t.classList.remove("active"),t.previousElementSibling?t.previousElementSibling.classList.add("active"):document.querySelectorAll(".searchresult").forEach((e=>{e.nextElementSibling||e.classList.add("active")}))):document.querySelectorAll(".searchresult").forEach((e=>{e.nextElementSibling&&e.classList.add("active")}));let n=document.querySelector(".searchresult.active");n&&n.scrollIntoView({behavior:"smooth",block:"nearest",inline:"start"})}if("Enter"===e.key){e.preventDefault();let t=document.querySelector(".searchresult.active");t&&(window.location.href=t.querySelector("a").href)}}}));const t=debounce(search,200,!1);field=document.querySelector("#term"),field.addEventListener("keydown",(e=>{"ArrowDown"!==e.key&&"ArrowUp"!==e.key&&t()})),resultsDiv=document.querySelector("#search-results");const n=new URL(location.href).searchParams;n.get("q")&&(field.setAttribute("value",n.get("q")),toggleSearch(),search())}async function search(){let e=field.value.trim();if(!e)return;if(e==lastSearch)return;console.log(`search for ${e}`),window.lastSearch=e,resultsDiv.innerHTML=loadingSvg;let t=offlineSearch(e),n="";if(!t.length){let t=document.createElement("p");return t.innerText=`No results for "${e}"`,resultsDiv.innerHTML="",void resultsDiv.appendChild(t)}n+='<div style="max-width:100%;">',t.forEach((e=>{e.tags&&e.tags.length>0?n+=`<div class="searchresult">\n <a class="search-link" href="${e.url}">${e.title}</a>\n <div onclick="window.location='${e.url}'">\n <div class="header-meta">\n <div class="header-tags">\n ${e.tags.map((e=>'<a class="tag" href="JavaScript:Void(0);">#'+e+"</a>")).join("")}\n </div>\n </div>\n ${e.content}\n </div>\n </div>`:n+=`<div class="searchresult">\n <a class="search-link" href="${e.url}">${e.title}</a>\n <div onclick="window.location='${e.url}'">\n ${e.content}\n </div>\n </div>`})),n+="</div>",resultsDiv.innerHTML=n}function truncate(e,t){return(e=e.replaceAll(/<[^>]*>/g,"")).length<t?e:e.substring(0,t-3)+"..."}function offlineSearch(e){let t=window.docs,n="#"===e[0]&&e.length>1?index.search(e.substring(1),[{field:"tags"}]):index.search(e,[{field:"title",limit:5},{field:"content",weight:10}]);const a=e=>{const t=n.filter((t=>t.field===e));return 0===t.length?[]:[...t[0].result]};return[...new Set([...a("title"),...a("content"),...a("tags")])].map((e=>{let n=t[e];return n.content=truncate(n.content,400),n.tags=n.tags.filter((e=>"gardenEntry"!=e&&"note"!=e)),n}))}window.lastSearch=""</script>
<main class="content cm-s-obsidian">
<header>
<div class="header-meta">
Expand Down
Loading

0 comments on commit f9f5048

Please sign in to comment.