Skip to content

Commit

Permalink
deploy: 0e51fae
Browse files Browse the repository at this point in the history
  • Loading branch information
anissen committed Aug 30, 2024
1 parent df885e3 commit df31ebd
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
8 changes: 4 additions & 4 deletions feed.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
<title>tinyThinks</title>
<link href="http://andersnissen.com/feed.xml" rel="self" >
<link href="http://andersnissen.com" >
<updated>2024-08-30T19:57:06Z</updated>
<updated>2024-08-30T20:17:01Z</updated>
<id>http://andersnissen.com</id>
<entry>
<title>
tinyThinks

</title>
<updated>2024-08-30T19:56:57Z</updated>
<updated>2024-08-30T20:16:52Z</updated>
<id>http://andersnissen.com/tiny-thinks/tiny-thinks/tiny-thinks/</id>
<content type="html">
&lt;h2 id=&quot;physical-games&quot; tabindex=&quot;-1&quot;&gt;Physical games&lt;/h2&gt;
Expand All @@ -28,7 +28,7 @@
Setup

</title>
<updated>2024-08-30T19:56:57Z</updated>
<updated>2024-08-30T20:16:52Z</updated>
<id>http://andersnissen.com/tiny-thinks/tiny-thinks/physical-games/dungeon-descend/setup/</id>
<content type="html">
&lt;p&gt;The like is setup like so:&lt;/p&gt;
Expand All @@ -45,7 +45,7 @@
Dungeon Descend

</title>
<updated>2024-08-30T19:56:57Z</updated>
<updated>2024-08-30T20:16:52Z</updated>
<id>http://andersnissen.com/tiny-thinks/tiny-thinks/physical-games/dungeon-descend/dungeon-descend/</id>
<content type="html">
&lt;p&gt;Here&#39;s some info.&lt;/p&gt;
Expand Down
6 changes: 3 additions & 3 deletions searchIndex.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
[
{
"title": "Dungeon Descend",
"date":"Fri Aug 30 2024 19:56:57 GMT+0000 (Coordinated Universal Time)",
"date":"Fri Aug 30 2024 20:16:52 GMT+0000 (Coordinated Universal Time)",
"url":"/tiny-thinks/physical-games/dungeon-descend/dungeon-descend/",
"content": "Here's some info.\nRules:\n<a class=\"internal-link\" target=\"\" data-note-icon=\"\" href=\"/tiny-thinks/physical-games/dungeon-descend/setup/\">Dungeon Descend/Setup</a>",
"tags": [ "note"]
},

{
"title": "Setup",
"date":"Fri Aug 30 2024 19:56:57 GMT+0000 (Coordinated Universal Time)",
"date":"Fri Aug 30 2024 20:16:52 GMT+0000 (Coordinated Universal Time)",
"url":"/tiny-thinks/physical-games/dungeon-descend/setup/",
"content": "The like is setup like so:\n\nFirst\nSecond",
"tags": [ "note"]
},

{
"title": "tinyThinks",
"date":"Fri Aug 30 2024 19:56:57 GMT+0000 (Coordinated Universal Time)",
"date":"Fri Aug 30 2024 20:16:52 GMT+0000 (Coordinated Universal Time)",
"url":"/tiny-thinks/tiny-thinks/",
"content": "Physical games\n\n<a class=\"internal-link\" target=\"\" data-note-icon=\"\" href=\"/tiny-thinks/physical-games/dungeon-descend/dungeon-descend/\">Dungeon Descend</a>\nOthers ...\nEven more others ...",
"tags": [ "note"]
Expand Down
8 changes: 4 additions & 4 deletions sitemap.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,22 @@

<url>
<loc>http://andersnissen.com/tiny-thinks/404/</loc>
<lastmod>2024-08-30T19:56:57.421Z</lastmod>
<lastmod>2024-08-30T20:16:52.069Z</lastmod>
</url>

<url>
<loc>http://andersnissen.com/tiny-thinks/tiny-thinks/physical-games/dungeon-descend/dungeon-descend/</loc>
<lastmod>2024-08-30T19:56:57.425Z</lastmod>
<lastmod>2024-08-30T20:16:52.073Z</lastmod>
</url>

<url>
<loc>http://andersnissen.com/tiny-thinks/tiny-thinks/physical-games/dungeon-descend/setup/</loc>
<lastmod>2024-08-30T19:56:57.425Z</lastmod>
<lastmod>2024-08-30T20:16:52.073Z</lastmod>
</url>

<url>
<loc>http://andersnissen.com/tiny-thinks/tiny-thinks/tiny-thinks/</loc>
<lastmod>2024-08-30T19:56:57.425Z</lastmod>
<lastmod>2024-08-30T20:16:52.073Z</lastmod>
</url>

</urlset>
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ <h1 style="margin:15px!important">tinyThinks</h1>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/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-08-30T19:57:06.254Z"===t){e=!1;let t=createIndex(n);window.docs=n,window.index=t}}if(e){let e=await(await fetch("/searchIndex.json?v=2024-08-30T19:57:06.254Z")).json(),t=createIndex(e);localStorage.setItem("searchIndex",JSON.stringify({date:"2024-08-30T19:57:06.254Z",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-08-30T20:17:01.263Z"===t){e=!1;let t=createIndex(n);window.docs=n,window.index=t}}if(e){let e=await(await fetch("/searchIndex.json?v=2024-08-30T20:17:01.263Z")).json(),t=createIndex(e);localStorage.setItem("searchIndex",JSON.stringify({date:"2024-08-30T20:17:01.263Z",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 df31ebd

Please sign in to comment.