Skip to content

Commit

Permalink
Fix author isn't npm_user
Browse files Browse the repository at this point in the history
  • Loading branch information
sweetpi committed Jul 24, 2016
1 parent 2d6ecfa commit 6468bd8
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
20 changes: 17 additions & 3 deletions docpad.coffee
Expand Up @@ -103,9 +103,23 @@ docpadConfig =
require: (file) -> require file

author: (p) ->
href = p.author?.url or p.autor_url or p._npmUser.url
name = "#{p.author?.name or p.author_name or "?"} (#{p._npmUser.name})"
return {href, name}
name = p.author?.name or p.author_name
url = p.author?.url or p.autor_url
email = p.author?.email or p.autor_email


maintainer = null
for m in p.maintainers
if (email? and email is m.email)
maintainer = m
break
if maintainer?
if name?
name = "#{name} (#{maintainer.name})"
else
name = maintainer.name

return {href: url, name: name}

printConfigShema: (schema) ->
ck = require 'coffeekup'
Expand Down
5 changes: 1 addition & 4 deletions src/documents/pages/plugins.html.coffee
Expand Up @@ -23,10 +23,7 @@ repositoryLink = (p) ->
npmLink = (p) ->
return "https://www.npmjs.com/package/#{p.name}"

author = (p) ->
href = p.author?.url or p.autor_url or p._npmUser.url
name = "#{p.author?.name or p.author_name or "?"} (#{p._npmUser.name})"
return {href, name}
author = @author

div class: "plugin-list", ->
for plugin in plugins
Expand Down

0 comments on commit 6468bd8

Please sign in to comment.