${heading}
+${description}
`; + return htmlCode.replace(/\$page_name/g, util.capitalize(heading)); +} + + // Create the output for the archive.html file try { // Add the static part - archivedOutput += `${archivedStartPart}\n`; + let heading = "Snippets Archive"; + let description = "These snippets, while useful and interesting, didn't quite make it into the repository due to either having very specific use-cases or being outdated. However we felt like they might still be useful to some readers, so here they are."; + let htmlCode = staticPageStartGenerator(staticPageStartPart, heading, description); + + archivedOutput += htmlCode; // Filter README.md from folder const filteredArchivedSnippets = filterSnippets(archivedSnippets, ['README.md']); @@ -274,7 +309,7 @@ try { (match, p1, p2, p3) => `${p1}${p2}${p3}` ); - archivedOutput += `${archivedEndPart}`; + archivedOutput += `${staticPageEndPart}`; // Generate and minify 'archive.html' file const minifiedArchivedOutput = minifyHTML(archivedOutput); @@ -289,7 +324,10 @@ try { // Create the output for the glossary.html file try { // Add the static part - glossaryOutput += `${glossaryStartPart}\n`; + let heading = "Glossary"; + let description = "Developers use a lot of terminology daily. Every once in a while, you might find a term you do not know. We know how frustrating that can get, so we provide you with a handy glossary of frequently used web development terms."; + let htmlCode = staticPageStartGenerator(staticPageStartPart, heading, description); + glossaryOutput += htmlCode; // Filter README.md from folder const filteredGlossarySnippets = filterSnippets(glossarySnippets, ['README.md']); @@ -304,11 +342,10 @@ try { .replace(/<\/h3>/g, '') + ''; - glossaryOutput += `${glossaryEndPart}`; + glossaryOutput += `${staticPageEndPart}`; // Generate and minify 'glossary.html' file const minifiedGlossaryOutput = minifyHTML(glossaryOutput); - fs.writeFileSync(path.join(docsPath, 'glossary.html'), minifiedGlossaryOutput); console.log(`${chalk.green('SUCCESS!')} glossary.html file generated!`); } catch (err) { diff --git a/static-parts/archived-page-start.html b/static-parts/archived-page-start.html deleted file mode 100644 index c010db460..000000000 --- a/static-parts/archived-page-start.html +++ /dev/null @@ -1,108 +0,0 @@ - - - - -
30 seconds of code
- Curated collection of useful JavaScript snippets that you can understand in 30 seconds or less.
-
- -
Snippets Archive
-These snippets, while useful and interesting, didn't quite make it into the repository due to either having very specific use-cases or being outdated. However we felt like they might still be useful to some readers, so here they are.
diff --git a/static-parts/glossary-page-end.html b/static-parts/glossary-page-end.html deleted file mode 100644 index d0c552dd1..000000000 --- a/static-parts/glossary-page-end.html +++ /dev/null @@ -1,18 +0,0 @@ -