Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[next] support external for editlink #694

Closed
4 tasks done
RainKolwa opened this issue Jun 2, 2022 · 6 comments · Fixed by #698
Closed
4 tasks done

[next] support external for editlink #694

RainKolwa opened this issue Jun 2, 2022 · 6 comments · Fixed by #698
Labels
bug Something isn't working

Comments

@RainKolwa
Copy link
Contributor

Is your feature request related to a problem? Please describe.

My project is hosted on GitLab, so I configured editLink as below:

editLink: {
    repo: 'https://gitlab.com/foo/bar',
    branch: 'main',
    dir: 'docs',
    text: '在 GitLab 上编辑此页',
}

but the editlink turned out to be https://github.com/https://gitlab.com/foo/bar/docs/edit/main/docs/application/management.md

Describe the solution you'd like

I noticed before v1.0.0, we have a isExternal function to tell if use github.com or repo config directly as base url.

Describe alternatives you've considered

No response

Additional context

No response

Validations

@brc-dd brc-dd added the bug Something isn't working label Jun 2, 2022
@brc-dd
Copy link
Member

brc-dd commented Jun 2, 2022

Except for leading https://github.com/, that URL is fine right? Or do GitLab's edit links look different?

@RainKolwa
Copy link
Contributor Author

Yes, except for the leading the URL is fine.

@alexeyvokin
Copy link

alexeyvokin commented Jun 2, 2022

I was also surprised that this functionality has degraded. I will be looking forward to the changes

@kiaking
Copy link
Member

kiaking commented Jun 6, 2022

@brc-dd @kecrily This is kinda getting complicated 😅 Before we were using this info to display GitHub social link logo on Nav bar as well, so it made sense to have these small options. But now, this option is really only used for this edit link. So, how about we make config simpler?

editLink: {
  path: 'https://github.com/vuejs/vitepress/edit/next/docs/{:path}',
  text: '在 GitLab 上编辑此页',
}

The {:path} gets replaced with the file path. All other stuff like repo, branch, dir just go into the static url string. Straight forward and user may configure it freely.

What do you think?

@brc-dd
Copy link
Member

brc-dd commented Jun 6, 2022

@kiaking Seems right. In pattern we are simply replacing :repo, :branch and :path. Since repo and branch aren't being used anywhere else, there is no need for us to inject them in pattern. Users can specify them directly in pattern.

@kecrily
Copy link
Contributor

kecrily commented Jun 6, 2022

If we won't be reusing these options elsewhere, then let's drop the baggage and simply get on with it.

kiaking added a commit that referenced this issue Jun 6, 2022
close #694
close #697

Co-authored-by: Kia Ishii <kia.king.08@gmail.com>
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants