diff --git a/mkdocs_git_committers_plugin_2/plugin.py b/mkdocs_git_committers_plugin_2/plugin.py index eef33b1..74cdfc8 100644 --- a/mkdocs_git_committers_plugin_2/plugin.py +++ b/mkdocs_git_committers_plugin_2/plugin.py @@ -106,18 +106,18 @@ def get_git_info(self, path): LOG.debug(" Found!") author_id = c.author.email else: - # If not found, search by name - LOG.debug(" User not found by email, search by name: " + c.author.name) + # If not found, search by name, expecting it to be GitHub user name + LOG.debug(" User not found yet, trying with GitHub username: " + c.author.name) info = self.get_gituser_info( c.author.name, \ - { 'query': '{ search(type: USER, query: "in:name ' + c.author.name + '", first: 1) { edges { node { ... on User { login name url } } } } }' }) + { 'query': '{ search(type: USER, query: "in:user ' + c.author.name + '", first: 1) { edges { node { ... on User { login name url } } } } }' }) if info: LOG.debug(" Found!") author_id = c.author.name else: - # If not found, search by name, expecting it to be GitHub user name - LOG.debug(" User not found yet, trying with GitHub username: " + c.author.name) + # If not found, search by name + LOG.debug(" User not found by email, search by name: " + c.author.name) info = self.get_gituser_info( c.author.name, \ - { 'query': '{ search(type: USER, query: "in:user ' + c.author.name + '", first: 1) { edges { node { ... on User { login name url } } } } }' }) + { 'query': '{ search(type: USER, query: "in:name ' + c.author.name + '", first: 1) { edges { node { ... on User { login name url } } } } }' }) if info: LOG.debug(" Found!") author_id = c.author.name diff --git a/setup.py b/setup.py index 5fc6d4b..9368ee3 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ setup( name='mkdocs-git-committers-plugin-2', - version='0.4.3', + version='0.4.4', description='An MkDocs plugin to create a list of contributors on the page', long_description='The git-committers plugin will seed the template context with a list of github committers and other useful GIT info such as last modified date', keywords='mkdocs pdf github',