trilbymedia / grav-plugin-git-sync

Collaboratively Synchronize your Grav `user` folder hosted on GitHub, BitBucket or GitLab
Apache License 2.0
243 stars 58 forks source link

Slash is not add at the end of a custom git repository url for the "Edit this page" link #86

Closed amiram closed 6 years ago

amiram commented 6 years ago

Steps to reproduce:

  1. Set the git remote url to "others" with the repo url without a slash at the end. e.g. http://tfs-host.com/tfs/MyCollection/MyProject/_git/wiki

  2. Open a page and click on the "Edit this Page" link.

Expected result: Link should be http://tfs-host.com/tfs/MyCollection/MyProject/_git/wiki/blob/master/pages

Actual Result: Link is http://tfs-host.com/tfs/MyCollection/MyProject/_git/wikiblob/master/pages

Workaround: Add a slash in the repo url http://tfs-host.com/tfs/MyCollection/MyProject/_git/wiki/

BTW, it is not happening with github.

paulhibbitts commented 6 years ago

Hi @amiram , sounds like you were able to solve this issue by further adjusting the source git URL, is that right?

amiram commented 6 years ago

Yes, but a note can be added to make it clear to the user or even better to fix it in code. I tried to find how to do it but didn't. If you instruct me where to fix it I can open a PR for that.

paulhibbitts commented 6 years ago

All three Git Sync themes have a Twig file to handle URL calc/display, which can be found in the folder user/themes/THEMENAME/templates/partials/gitrepo_link.html.twig

Your use case might be unique, so perhaps handling it by using a custom Git Sync URL in site config vs. adding a special case might be the best way to handle it? For sure I could also add a note in the readme for the theme as well, thanks.

amiram commented 6 years ago

Pardon me but I'm new to grav. I found the folder in my grav instance, but not in your repo.

paulhibbitts commented 6 years ago

No problem, which Git Sync theme of mine are you using?

amiram commented 6 years ago

learn-2

paulhibbitts commented 6 years ago

Learn 2, not Learn2 with Git Sync? Oh, if that is the case this is the repo: https://github.com/getgrav/grav-theme-learn2

My Learn2 with Git Sync theme contains a lot of auto-calculation stuff for URLs https://github.com/hibbitts-design/grav-theme-learn2-git-sync so please make sure you've got the right theme🙂

amiram commented 6 years ago

Oh I got it now. I'm using learn2 with git sync. I'll find it there. Thanks

paulhibbitts commented 6 years ago

Great! FYI, in the Learn2 with Git Sync Theme settings you can modify the base Edit this Page in Git URL

paulhibbitts commented 6 years ago

If you want to pursue this, perhaps close this issue here and open a new one in my repo? https://github.com/hibbitts-design/grav-theme-learn2-git-sync Thanks.