diff --git a/build.js b/build.js index 909132bfbe188..e419eb2698366 100755 --- a/build.js +++ b/build.js @@ -159,7 +159,6 @@ function buildLocale(source, locale, opts) { }) ) .use(markdown(markedOptions)) - .use(githubLinks({ locale, site: i18nJSON(locale) })) // Set pretty permalinks, we don't want .html suffixes everywhere. .use( permalinks({ @@ -195,6 +194,7 @@ function buildLocale(source, locale, opts) { .use(hbsReg()) .use(scriptReg()) .use(layouts()) + .use(githubLinks({ locale, site: i18nJSON(locale) })) // Pipes the generated files into their respective subdirectory in the build // directory. .destination(path.join(__dirname, 'build', locale)) diff --git a/layouts/partials/footer.hbs b/layouts/partials/footer.hbs index 5f42d3d35b9ff..e71fec27d4f6e 100644 --- a/layouts/partials/footer.hbs +++ b/layouts/partials/footer.hbs @@ -14,10 +14,8 @@ Trademark Policy | Trademark List | Cookie Policy -

- +

+ diff --git a/scripts/plugins/githubLinks.js b/scripts/plugins/githubLinks.js index 53d4d07525949..33a501b501547 100644 --- a/scripts/plugins/githubLinks.js +++ b/scripts/plugins/githubLinks.js @@ -17,10 +17,18 @@ function githubLinks(options) { const file = files[path]; path = path.replace('.html', '.md').replace(/\\/g, '/'); const url = `https://github.com/nodejs/nodejs.org/edit/main/locale/${options.locale}/${path}`; - - const contents = - file.contents.toString() + - ` `; + const editOnGitHubTrans = options.site.editOnGithub || 'Edit on GitHub'; + const replCallBack = (match, $1, $2) => { + return ``; + }; + const contents = file.contents + .toString() + .replace( + /