filter has_ list from actual frontmatter to keep the order

This commit is contained in:
Marcell Mars 2021-04-26 00:40:30 +02:00
parent 765c1e2b51
commit dfb272ba6d

View file

@ -38,16 +38,20 @@
relpath = repo.path; relpath = repo.path;
relpermalink = repo.relpermalink relpermalink = repo.relpermalink
protocol = document.location.protocol.substring(0,4) protocol = document.location.protocol.substring(0,4)
let tkey = Object.keys(repo.frontmatter).filter(t => t.toLowerCase() == "title")[0] let tkey = Object.keys(repo.frontmatter).filter(t => t.toLowerCase() == "title")[0]
title = repo.frontmatter[tkey] title = repo.frontmatter[tkey]
let xastiers = Object.keys(repo.frontmatter).filter(t => t.startsWith("has_")) let xastiers = Object.keys(repo.frontmatter).filter(t => t.toLowerCase().startsWith("has_"))
if (xastiers.length > 0) { if (xastiers.length == 1) {
hastiers = xastiers[0].substr(4) hastiers = xastiers[0].substr(4)
tiers = METASP[xastiers[0].split("has_")[1]].tiers.filter(t => repo.frontmatter[xastiers].includes(t.file)) tiers = []
if (xastiers.length == 1) { repo.frontmatter[xastiers[0]].forEach(t => {
candidates = diffArrr(METASP[xastiers[0].split("has_")[1]].tiers, tiers) 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` el.src = `../js/repo/${location.hash.substring(1)}.js`