filter has_ list from actual frontmatter to keep the order
This commit is contained in:
parent
765c1e2b51
commit
dfb272ba6d
1 changed files with 11 additions and 7 deletions
|
@ -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`
|
||||||
|
|
Loading…
Add table
Reference in a new issue