on master help sign in
Merge pull request #295 from ckipp01/bugfix/lists-not-counted
607b077Chris
scripts/wiki.js+3−3
@@ -39,7 +39,7 @@ const Wiki = sites => {
39
39
40 const storeEntries = (author, url, category, entries) => {
40 const storeEntries = (author, url, category, entries) => {
41 Array.isArray(entries)
41 Array.isArray(entries)
42− ? storeEntry(author, url, category, 'list-definitions', entries)
42+ ? storeEntry(author, url, category, `${category}-list-definition`, entries)
43 : Object.keys(entries).forEach(entry => storeEntry(author, url, category, entry, entries[entry]))
43 : Object.keys(entries).forEach(entry => storeEntry(author, url, category, entry, entries[entry]))
44 }
44 }
45
45
@@ -95,7 +95,7 @@ const Wiki = sites => {
95
95
96 const formatEntries = entries => (currentHtml, category) => {
96 const formatEntries = entries => (currentHtml, category) => {
97 const definitions = entries[category].reduce(formatEntry, '')
97 const definitions = entries[category].reduce(formatEntry, '')
98− const title = category === 'list-definitions'
98+ const title = category.endsWith('list-definition')
99 ? ''
99 ? ''
100 : `<li class='name'><strong>${category.toLowerCase()}</strong></li>`
100 : `<li class='name'><strong>${category.toLowerCase()}</strong></li>`
101 return `${currentHtml}<ul class='term'>${title}${definitions}</ul>`
101 return `${currentHtml}<ul class='term'>${title}${definitions}</ul>`
@@ -108,7 +108,7 @@ const Wiki = sites => {
108 }
108 }
109
109
110 const foundMatches = Object.keys(entries[key])
110 const foundMatches = Object.keys(entries[key])
111− .filter(entry => entry !== 'list-definitions')
111+ .filter(entry => !entry.endsWith('list-definition'))
112 .map(searchOtherCategories)
112 .map(searchOtherCategories)
113 const flattened = [].concat.apply([], foundMatches)
113 const flattened = [].concat.apply([], foundMatches)
114 return Array.from(new Set(flattened)).filter(related => related !== key)
114 return Array.from(new Set(flattened)).filter(related => related !== key)