GitHub organization URL in `repo_url` generate Javascript error #337

Closed
kcgthb opened this Issue May 19, 2017 · 4 comments

Comments

Projects
None yet
2 participants
@kcgthb

kcgthb commented May 19, 2017

Description

I'm not 100% sure if that one is on MkDocs or MkDocs-Material side, but when using a GitHub organization URL for repo_url in mkdocs.yml (such as https://github.com/orgname) instead of the regular project URL (https://github.com/user/project), the following JavaScript exception is generated:

application-6b4ff16fa7.js:3 Uncaught TypeError: Invalid attempt to destructure non-iterable instance
    at application-6b4ff16fa7.js:3
    at new t (application-6b4ff16fa7.js:3)
    at application-6b4ff16fa7.js:1
    at Object.r (application-6b4ff16fa7.js:1)
    at (index):662

Expected behavior

No javascript error

Actual behavior

JS exception

Steps to reproduce the bug

  1. Clone the mkdocs-material repo
  2. edit mkdocs.yml and replace the repo_url value by https://github.com/orgname
  3. yarn run start and look at the browser console

Package versions

  • Python: python --version: Python 2.7.13
  • MkDocs: mkdocs --version: mkdocs, version 0.16.3
  • Material: pip show mkdocs-material | grep -E ^Version: master

Project configuration

https://github.com/squidfunk/mkdocs-material/blob/master/mkdocs.yml

System information

  • OS: Debian 9.0
  • Browser: Chrome 58
@squidfunk

This comment has been minimized.

Show comment
Hide comment
@squidfunk

squidfunk May 20, 2017

Owner

Well, I haven't anticipated that people would link their accounts/organizations but it seems reasonable. When doing this, no stars can be loaded, so we'll just display nothing under the name of the organization I would say.

Owner

squidfunk commented May 20, 2017

Well, I haven't anticipated that people would link their accounts/organizations but it seems reasonable. When doing this, no stars can be loaded, so we'll just display nothing under the name of the organization I would say.

@squidfunk squidfunk self-assigned this May 20, 2017

@squidfunk squidfunk added the bug label May 20, 2017

@kcgthb

This comment has been minimized.

Show comment
Hide comment
@kcgthb

kcgthb May 20, 2017

Indeed, I think it's fine to not display any star in that case, just the link to the GitHub organization page.

To give some more context about my use case: I generate documentation from a private repo, but would still use the "edit on GitHub" link feature so authorized users could edit pages with a simple click. That means I need both edit_uri and repo_url defined. But since the repo is a private one, linking to it on each page doesn't seem very useful to me. So my plan is to have:

  • repo_url set to https://github.com/orgname
  • edit_uri set to reponame/path/to/docs

Thanks for looking into it!

kcgthb commented May 20, 2017

Indeed, I think it's fine to not display any star in that case, just the link to the GitHub organization page.

To give some more context about my use case: I generate documentation from a private repo, but would still use the "edit on GitHub" link feature so authorized users could edit pages with a simple click. That means I need both edit_uri and repo_url defined. But since the repo is a private one, linking to it on each page doesn't seem very useful to me. So my plan is to have:

  • repo_url set to https://github.com/orgname
  • edit_uri set to reponame/path/to/docs

Thanks for looking into it!

@squidfunk

This comment has been minimized.

Show comment
Hide comment
@squidfunk

squidfunk May 24, 2017

Owner

Fixed in #342 - I decided to show the number of repositories for user and organization links, so now it reads "11 Repositories" under the name of the repo. Will be released with 1.6.4 shortly.

Owner

squidfunk commented May 24, 2017

Fixed in #342 - I decided to show the number of repositories for user and organization links, so now it reads "11 Repositories" under the name of the repo. Will be released with 1.6.4 shortly.

@squidfunk squidfunk closed this May 24, 2017

@kcgthb

This comment has been minimized.

Show comment
Hide comment
@kcgthb

kcgthb May 24, 2017

Very nice, thank you @squidfunk!

kcgthb commented May 24, 2017

Very nice, thank you @squidfunk!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment