From bbd395bf312aa9169ecc98276b5c08e9cbf80058 Mon Sep 17 00:00:00 2001 From: Aryan <89710210+aryandeelwal@users.noreply.github.com> Date: Thu, 6 Oct 2022 12:22:38 +0530 Subject: [PATCH] docs: improved keywords in index.html file (#47780) * Done Short-Circuiting in docs/index.html file * Refactor(change var to let and const) the code in docs/index.html file * Update docs/index.html Co-authored-by: Oliver Eyton-Williams * Update docs/index.html Co-authored-by: Naomi Carrigan Co-authored-by: Oliver Eyton-Williams Co-authored-by: Naomi Carrigan --- docs/index.html | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/docs/index.html b/docs/index.html index 3f2f69a5047..0d576d4de1c 100644 --- a/docs/index.html +++ b/docs/index.html @@ -166,12 +166,13 @@ plugins: [ function (hook, vm) { hook.beforeEach(function (markdown) { + let dynamicText; // -- ignore the translations list page if (vm.route.file === '_translations.md') return markdown; // -- add "Update this translation" link for all i18n language pages if (vm.route.path.search('i18n') !== -1) { - var dynamicText = + dynamicText = '[ Update the translation](' + 'https://translate.freecodecamp.org/contributing-docs' + ') or [visit the English version](' + @@ -182,7 +183,7 @@ // -- add "Edit this guide on GitHub" link for all English language pages if (vm.route.path.search('i18n') === -1) { - var dynamicText = + dynamicText = '[ Edit this guide on GitHub](' + 'https://github.com/freeCodeCamp/freeCodeCamp/blob/main/docs/' + vm.route.file + @@ -196,13 +197,13 @@ vm.route.path.search('Hebrew') !== -1 ) { for ( - var counter = 0, + let counter = 0, elements = document.getElementsByClassName('markdown-section'); counter < elements.length; counter++ ) { - var item = elements[counter]; + const item = elements[counter]; item.dir = 'rtl'; } } @@ -212,13 +213,13 @@ vm.route.path.search('Hebrew') === -1 ) { for ( - var counter = 0, + let counter = 0, elements = document.getElementsByClassName('markdown-section'); counter < elements.length; counter++ ) { - var item = elements[counter]; + const item = elements[counter]; item.dir = 'ltr'; } }