From eb3e4b62d60b2e9f6eeccb3654ad3b3bb8e3cf01 Mon Sep 17 00:00:00 2001 From: Marcell Mars Date: Thu, 15 Apr 2021 00:55:21 +0200 Subject: [PATCH] moved `couldhave` into METASP coming from hugo's metadata/index.js also Escape goes one page back to the original page edit page tries to edit --- src/App.svelte | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/App.svelte b/src/App.svelte index 99fedd9..163a092 100644 --- a/src/App.svelte +++ b/src/App.svelte @@ -2,7 +2,7 @@ import { onMount } from 'svelte'; let v = "loading..."; let path = "loading..."; - var couldhave = [] + let couldhave = [] function disableButtons() { let tierbox = [...document.querySelector(".tierbox").children] @@ -186,14 +186,20 @@ v = v.substring(1) } path = repo.path; - couldhave = repo.couldhave; + couldhave = METASP[Object.keys(repo.frontmatter).filter(t => t.startsWith("has_"))[0].split("has_")[1]].tiers console.log(JSON.stringify(repo)) - generateFrontMatter(repo.frontmatter, path, repo.relpermalink, document.location.protocol.substring(0,4)) + generateFrontMatter(repo.frontmatter, path, repo.relpermalink, document.location.protocol.substring(0,4)) } el.src = `../js/repo/${location.hash.substring(1)}.js` document.body.appendChild(el) } + function keyUp(e) { + if (e.key == "Escape") { + window.history.back() + } + } + onMount(()=> { dispatchHash() }) @@ -201,7 +207,7 @@ $: hashChanged = ()=> dispatchHash(); - +