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
This commit is contained in:
Marcell Mars 2021-04-15 00:55:21 +02:00
parent 129e2ba1c7
commit eb3e4b62d6
1 changed files with 10 additions and 4 deletions

View File

@ -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();
</script>
<svelte:window on:hashchange={hashChanged} />
<svelte:window on:hashchange={hashChanged} on:keyup={keyUp}/>
<main id="sandpoints">
<form>
<label for="content">Content:</label>