Skip to content

Commit

Permalink
Fixed builder for advanced snippet links
Browse files Browse the repository at this point in the history
Resolves Chalarangelo#159. Final  changes, multi-tagging complete.
  • Loading branch information
Chalarangelo committed Jan 5, 2018
1 parent 303d8e8 commit 3646b9b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions scripts/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,15 +106,15 @@ try {
if (capitalizedTag === 'Uncategorized') {
uncategorizedOutput += `### _${capitalizedTag}_\n\n<details>\n<summary>View contents</summary>\n\n`;
for (const taggedSnippet of Object.entries(tagDbData).filter(v => v[1][0] === tag)) {
uncategorizedOutput += `* [\`${taggedSnippet[0]}\`](#${taggedSnippet[0].toLowerCase()})\n`;
uncategorizedOutput += `* [\`${taggedSnippet[0]}\`](#${taggedSnippet[0].toLowerCase()}${taggedSnippet[1].includes('advanced')?'-':''})\n`;
}
uncategorizedOutput += '\n</details>\n\n';
} else {
output += `### ${
EMOJIS[tag] || ''
} ${capitalizedTag}\n\n<details>\n<summary>View contents</summary>\n\n`;
for (const taggedSnippet of Object.entries(tagDbData).filter(v => v[1][0] === tag)) {
output += `* [\`${taggedSnippet[0]}\`](#${taggedSnippet[0].toLowerCase()})\n`;
output += `* [\`${taggedSnippet[0]}\`](#${taggedSnippet[0].toLowerCase()}${taggedSnippet[1].includes('advanced')?'-':''})\n`;
}
output += '\n</details>\n\n';
}
Expand All @@ -137,7 +137,7 @@ try {
output += `---\n ## ${EMOJIS[tag] || ''} ${capitalizedTag}\n`;
for (const taggedSnippet of Object.entries(tagDbData).filter(v => v[1][0] === tag)) {
let data = snippets[taggedSnippet[0] + '.md'];
// Add advanced tag
// Add advanced tag
if(taggedSnippet[1].includes('advanced')){
data = data.split(/\r?\n/);
data[0] = data[0] +' ![advanced](/advanced.svg)';
Expand Down

0 comments on commit 3646b9b

Please sign in to comment.