From 995f91f5617b62204932bf0affbb02909cd3df28 Mon Sep 17 00:00:00 2001 From: tycrek Date: Mon, 1 Jun 2020 09:14:27 -0600 Subject: [PATCH] Added back to top button --- _build.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/_build.js b/_build.js index 5c4464c..ca16afd 100644 --- a/_build.js +++ b/_build.js @@ -27,6 +27,9 @@ const BUILD_SECTION = { closingRemarks: () => readFile('md/_closingRemarks.md') } +// Button that brings the user to the top of the page +const BACK_TO_TOP = '[![Back to top](https://img.shields.io/badge/Back%20to%20top-lightgrey.svg)](https://github.com/tycrek/degoogle#readme)'; + /** * Main method */ @@ -83,7 +86,7 @@ function generateCategorySection(header, data) { if (!data) return ''; // Set the header to HTML
- let categorySection = '## ' + header + os.EOL + os.EOL; + let categorySection = '## ' + header + ' ' + BACK_TO_TOP + os.EOL + os.EOL; // Generate service sections for this category Object.keys(data).forEach((key) => categorySection = categorySection.concat(generateServiceSection(data[key]) + os.EOL + os.EOL)); @@ -97,7 +100,7 @@ function generateCategorySection(header, data) { */ function generateServiceSection(data) { // Start the section with an

header and the start of a Markdown table - let serviceSection = `#### ${data[0].title + os.EOL + os.EOL}| Name | Eyes | Description |${os.EOL}| ---- | ---- | ----------- |${os.EOL}`; + let serviceSection = `#### ${data[0].title + ' ' + BACK_TO_TOP + os.EOL + os.EOL}| Name | Eyes | Description |${os.EOL}| ---- | ---- | ----------- |${os.EOL}`; let notes = os.EOL + ''; // Iterate over each alternative service and add it to the table data.forEach(item => {