diff --git a/build.js b/build.js index 0719df516f8de..670c081987d72 100755 --- a/build.js +++ b/build.js @@ -163,26 +163,23 @@ function buildLocale (source, locale) { pattern: '**/*.html', partials: 'layouts/partials', helpers: { + apidocslink: require('./scripts/helpers/apidocslink.js'), + changeloglink: require('./scripts/helpers/changeloglink.js'), copyright: require('./scripts/helpers/copyright-year.js'), equals: require('./scripts/helpers/equals.js'), + majorapidocslink: require('./scripts/helpers/majorapidocslink.js'), startswith: require('./scripts/helpers/startswith.js'), - changeloglink: require('./scripts/helpers/changeloglink.js'), strftime: require('./scripts/helpers/strftime.js'), - apidocslink: require('./scripts/helpers/apidocslink.js'), - majorapidocslink: require('./scripts/helpers/majorapidocslink.js'), + stripv: require('./scripts/helpers/stripv.js'), summary: require('./scripts/helpers/summary.js'), - json: function (context) { - return JSON.stringify(context) - }, - getListJson: function (context) { - var result = context.map(function (item) { - return { - title: item.title, - date: item.date, - local: true, - path: item.path.replace(/\\/, '/') - } - }) + json: (context) => JSON.stringify(context), + getListJson: (context) => { + const result = context.map(item => ({ + title: item.title, + date: item.date, + local: true, + path: item.path.replace(/\\/, '/') + })) return JSON.stringify(result) } } diff --git a/layouts/download-releases.hbs b/layouts/download-releases.hbs index a2e836dd288e7..8be6a99ad111d 100644 --- a/layouts/download-releases.hbs +++ b/layouts/download-releases.hbs @@ -32,7 +32,7 @@ {{#each project.versions}} - {{name}} {{version}} + {{name}} {{stripv version}} {{#if lts}}{{lts}}{{/if}} {{v8}} diff --git a/layouts/index.hbs b/layouts/index.hbs index 0f615437ccde4..af9238bd158ab 100644 --- a/layouts/index.hbs +++ b/layouts/index.hbs @@ -31,8 +31,8 @@
- - {{ project.latestVersions.lts.node }} {{ labels.lts }} + + {{stripv project.latestVersions.lts.node }} {{ labels.lts }} {{ labels.tagline-lts }} @@ -53,8 +53,8 @@ {{#if project.latestVersions.current.node}}
- - {{ project.latestVersions.current.node }} {{ labels.current }} + + {{stripv project.latestVersions.current.node }} {{ labels.current }} {{ labels.tagline-current }} diff --git a/layouts/partials/primary-download-matrix.hbs b/layouts/partials/primary-download-matrix.hbs index 8d808d7f29243..3fbfb1cc0968d 100644 --- a/layouts/partials/primary-download-matrix.hbs +++ b/layouts/partials/primary-download-matrix.hbs @@ -1,5 +1,5 @@
-

{{downloads.currentVersion}}: {{version.node}} (includes npm {{version.npm}})

+

{{downloads.currentVersion}}: {{stripv version.node}} (includes npm {{version.npm}})

{{downloads.intro}}

    diff --git a/scripts/helpers/stripv.js b/scripts/helpers/stripv.js new file mode 100644 index 0000000000000..3f853c522e613 --- /dev/null +++ b/scripts/helpers/stripv.js @@ -0,0 +1,3 @@ +'use strict' + +module.exports = (version) => version.replace(/^v/, '')