diff --git a/src/App.svelte b/src/App.svelte index 0a4a01c..ecc0258 100644 --- a/src/App.svelte +++ b/src/App.svelte @@ -38,16 +38,20 @@ relpath = repo.path; relpermalink = repo.relpermalink protocol = document.location.protocol.substring(0,4) - let tkey = Object.keys(repo.frontmatter).filter(t => t.toLowerCase() == "title")[0] title = repo.frontmatter[tkey] - let xastiers = Object.keys(repo.frontmatter).filter(t => t.startsWith("has_")) - if (xastiers.length > 0) { + let xastiers = Object.keys(repo.frontmatter).filter(t => t.toLowerCase().startsWith("has_")) + if (xastiers.length == 1) { hastiers = xastiers[0].substr(4) - tiers = METASP[xastiers[0].split("has_")[1]].tiers.filter(t => repo.frontmatter[xastiers].includes(t.file)) - if (xastiers.length == 1) { - candidates = diffArrr(METASP[xastiers[0].split("has_")[1]].tiers, tiers) - } + tiers = [] + repo.frontmatter[xastiers[0]].forEach(t => { + METASP[hastiers].tiers.forEach(f => { + if (f.file == t) { + tiers.push(f) + } + }) + }) + candidates = diffArrr(METASP[hastiers].tiers, tiers) } } el.src = `../js/repo/${location.hash.substring(1)}.js`