vuejs / vuepress

📝 Minimalistic Vue-powered static site generator
https://vuepress.vuejs.org
MIT License
22.43k stars 4.79k forks source link

` git editLinks ` is not correct on the gitea #2134

Open whmmm opened 4 years ago

whmmm commented 4 years ago

Feature request

What problem does this feature solve?

git editLinks is not correct on the gitea !

What does the proposed API look like?

image

How should this be implemented in your opinion?

Add a paramter in themeConfig

Are you willing to work on this yourself?

Yes,It's not a difficult question.

kefranabg commented 4 years ago

This issue should not be fixed with an extra field on themeConfig because it makes the users configuration more complex.

We had the same problem with bitbucket, here is how we fixed this. It should be the same process for gitea 😉

OrvilleQ commented 4 years ago

@kefranabg Gitea's edit link is basiclly the same as source but with an extra _ before edit

For example:

Edit link generate by default theme for source: https://random.gitea.com/User/Repo/edit/branch/folder/README.md

The true edit link gitea use: https://radom.gitea.com/User/Repo/_edit/branch/folder/README.md

Maybe you could just add an extra setting options to add that extra _

SvenC56 commented 4 years ago

@kefranabg how do I update override existing methods to adapt it do Gitea?

hendrikbl commented 3 years ago

@kefranabg The problem with the current solution is that it only works for the 'online' versions of said services. I have a self hosted gitea instance. Just checking for gitea.com would not help since a self hosted instance doesn't contain it. The same applies for GitLab.

My idea would be an optional field in themeConfig like repoProvider or something that takes values like github, gitlab, gitea etc. That could default to github or nothing so the current detection could step in if the provider is not explicitly specified.

With that most people would be fine without any additional config and people who need it can just set one more field wich is not too much I think.

bencodezen commented 3 years ago

@hendrikbl You bring up an excellent point. I think the tricky part will be figuring out the various use cases for the escape hatch when users want to do something custom.

For example, some of them may have different pre-pended strings, but some may need to add something at the end of the URL.

hendrikbl commented 3 years ago

Any news on this?

keitsi commented 1 year ago

Any updates?