vuepress icon indicating copy to clipboard operation
vuepress copied to clipboard

` git editLinks ` is not correct on the gitea

Open whmmm opened this issue 5 years ago • 7 comments

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.

whmmm avatar Jan 15 '20 03:01 whmmm

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 😉

kefranabg avatar Jan 26 '20 10:01 kefranabg

@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 _

OrvilleQ avatar Mar 12 '20 13:03 OrvilleQ

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

SvenC56 avatar Mar 19 '20 09:03 SvenC56

@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.

hendrikbl avatar Oct 13 '20 12:10 hendrikbl

@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.

bencodezen avatar Oct 13 '20 14:10 bencodezen

Any news on this?

hendrikbl avatar Mar 16 '21 07:03 hendrikbl

Any updates?

keitsi avatar Sep 02 '22 06:09 keitsi