ben-gibson / GitLink

A Jetbrains plugin that opens a local file under Git version control in its remote host using the default browser.
https://plugins.jetbrains.com/plugin/8183-gitlink
MIT License
728 stars 59 forks source link

Can't use {remote:url:host} or {remote:url:path} in template #261

Closed bernhof closed 1 year ago

bernhof commented 1 year ago

The following template is considered invalid, but I can't see why:

{remote:url:host}/git/{remote:url:path}/-/blob/{branch}/{file:path}/{file:name}#L{line:start}-{line:end}

Screenshot of invalid URL

I'm trying to inject "/git/" between host and repo path.

The following placeholders are listed in the dialog:

Placeholders

Is this a bug, or am I doing it wrong?

Using GitLink plugin version 4.2.4

ben-gibson commented 1 year ago

Sorry, I think the example shown for remote:url:host is wrong, it should be example.com, not https://example.com. I think, if you prepend the protocol, it should work. For example, https://{remote:url:host}/git/{remote:url:path}/-/blob/{branch}/{file:path}/{file:name}#L{line:start}-{line:end}

ben-gibson commented 1 year ago

I've updated the example in the latest version