diff options
-rw-r--r-- | lib/render.js | 12 | ||||
-rw-r--r-- | lib/serve.js | 12 |
2 files changed, 12 insertions, 12 deletions
diff --git a/lib/render.js b/lib/render.js index 5a0ddaa..9a3ad42 100644 --- a/lib/render.js +++ b/lib/render.js @@ -423,10 +423,10 @@ Render.prototype.npmPackageMention = function (link, opts, cb) { var done = multicb({pluck: 1, spread: true}) var base = '/npm/' + (opts.author ? u.escapeId(link.author) + '/' : '') var pathWithAuthor = opts.withAuthor ? '/npm/' + - u.escapeId(link.author) + '/' + - (opts.name ? opts.name + '/' + - (opts.version ? opts.version + '/' + - (opts.distTag ? opts.distTag + '/' : '') : '') : '') : '' + u.escapeId(link.author) + + (opts.name ? '/' + opts.name + + (opts.version ? '/' + opts.version + + (opts.distTag ? '/' + opts.distTag + '/' : '') : '') : '') : '' self.app.getAbout(link.author, done()) self.app.getBlobState(link.link, done()) done(function (err, about, blobState) { @@ -441,11 +441,11 @@ Render.prototype.npmPackageMention = function (link, opts, cb) { title: 'package name' }, name), ' '), h('td', version ? [h('a', { - href: self.toUrl(base + name + '/' + version + '/'), + href: self.toUrl(base + name + '/' + version), title: 'package version' }, version), ' '] : ''), h('td', distTag ? [h('a', { - href: self.toUrl(base + name + '//' + distTag + '/'), + href: self.toUrl(base + name + '//' + distTag), title: 'dist-tag' }, distTag), ' '] : ''), h('td', {align: 'right'}, link.size != null ? [h('span', { diff --git a/lib/serve.js b/lib/serve.js index c162e42..30689eb 100644 --- a/lib/serve.js +++ b/lib/serve.js @@ -1890,10 +1890,10 @@ Serve.prototype.npm = function (url) { var render = self.app.render var base = '/npm/' + (author ? u.escapeId(author) + '/' : '') - var pathWithoutAuthor = '/npm/' + - (name ? name + '/' + - (version ? version + '/' + - (distTag ? distTag + '/' : '') : '') : '') + var pathWithoutAuthor = '/npm' + + (name ? '/' + name + + (version ? '/' + version + + (distTag ? '/' + distTag : '') : '') : '') return pull( ph('section', {}, [ ph('h3', [ph('a', {href: render.toUrl('/npm/')}, 'npm'), ' : ', @@ -1908,7 +1908,7 @@ Serve.prototype.npm = function (url) { ]), ph('table', [ ph('thead', ph('tr', [ - !author ? ph('td', 'publisher') : '', + ph('td', 'publisher'), ph('td', 'package'), ph('td', 'version'), ph('td', 'tag'), @@ -1926,7 +1926,7 @@ Serve.prototype.npm = function (url) { }), paramap(function (link, cb) { self.app.render.npmPackageMention(link, { - withAuthor: !author, + withAuthor: true, author: author, name: name, version: version, |